mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-27 20:23:08 +00:00
update component/key names
This commit is contained in:
@@ -6,9 +6,9 @@ export const HINT_TYPE = {
|
||||
};
|
||||
|
||||
export const SNIPPET_TYPE = {
|
||||
DEFAULT : 0,
|
||||
INLINE_SNIPPET : 1,
|
||||
IMAGE : 2,
|
||||
BLOCK : 0,
|
||||
INLINE : 1,
|
||||
INJECTOR : 2,
|
||||
};
|
||||
|
||||
export const FIELD_TYPE = {
|
||||
@@ -18,9 +18,9 @@ export const FIELD_TYPE = {
|
||||
|
||||
export const PATTERNS = {
|
||||
snippet : {
|
||||
[SNIPPET_TYPE.DEFAULT] : (name)=>new RegExp(`^{{${name}(?:[^a-zA-Z].*)?`),
|
||||
[SNIPPET_TYPE.INLINE_SNIPPET] : (name)=>new RegExp(`{{${name}`),
|
||||
[SNIPPET_TYPE.IMAGE] : ()=>new RegExp(`^\\!\\[(?:[a-zA-Z -]+)?\\]\\(.*\\).*{[a-zA-Z0-9:, "'-]+}$`),
|
||||
[SNIPPET_TYPE.BLOCK] : (name)=>new RegExp(`^{{${name}(?:[^a-zA-Z].*)?`),
|
||||
[SNIPPET_TYPE.INLINE] : (name)=>new RegExp(`{{${name}`),
|
||||
[SNIPPET_TYPE.INJECTOR] : ()=>new RegExp(`^\\!\\[(?:[a-zA-Z -]+)?\\]\\(.*\\).*{[a-zA-Z0-9:, "'-]+}$`),
|
||||
},
|
||||
field : {
|
||||
[FIELD_TYPE.TEXT] : (name)=>new RegExp(`[{,;](${name}):("[^},;"]*"|[^},;]*)`),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Field = require('./field/field.jsx');
|
||||
const Text = require('./text/text.jsx');
|
||||
const Checkbox = require('./checkbox/checkbox.jsx');
|
||||
|
||||
module.exports = {
|
||||
Field : Field,
|
||||
Text : Text,
|
||||
Checkbox : Checkbox,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require('./field.less');
|
||||
require('./text.less');
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
const _ = require('lodash');
|
||||
@@ -10,7 +10,7 @@ const STYLE_FN = (value)=>({
|
||||
width : `calc(${value?.length ?? 0}ch + ${value?.length ? `${DEFAULT_WIDTH} / 2` : DEFAULT_WIDTH})`
|
||||
});
|
||||
|
||||
const Field = createClass({
|
||||
const Text = createClass({
|
||||
fieldRef : {},
|
||||
|
||||
getDefaultProps : function() {
|
||||
@@ -157,4 +157,4 @@ const Field = createClass({
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = Field;
|
||||
module.exports = Text;
|
||||
Reference in New Issue
Block a user