0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-23 15:18:14 +00:00

add image selector field type, modal component, and new snippet widgets

This commit is contained in:
Charlie Humphreys
2023-07-16 02:14:43 -05:00
parent e6055bd417
commit bef6b94dc4
10 changed files with 301 additions and 17 deletions

View File

@@ -12,8 +12,9 @@ export const SNIPPET_TYPE = {
};
export const FIELD_TYPE = {
TEXT : 0,
CHECKBOX : 1
TEXT : 0,
CHECKBOX : 1,
IMAGE_SELECTOR : 2,
};
export const PATTERNS = {
@@ -23,7 +24,8 @@ export const PATTERNS = {
[SNIPPET_TYPE.INJECTOR] : ()=>new RegExp(`^\\!\\[(?:[a-zA-Z -]+)?\\]\\(.*\\).*{[a-zA-Z0-9:, "'-]+}$`),
},
field : {
[FIELD_TYPE.TEXT] : (name)=>new RegExp(`[{,;](${name}):([^};,"\\(]*\\((?!,)[^};"\\)]*\\)|"[^},;"]*"|[^},;]*)`),
[FIELD_TYPE.TEXT] : (name)=>new RegExp(`[{,;](${name}):([^};,"\\(]*\\((?!,)[^};"\\)]*\\)|"[^},;"]*"|[^},;]*)`),
[FIELD_TYPE.IMAGE_SELECTOR] : (name)=>new RegExp(`{{(${name})(\\d*)`),
},
collectStyles : new RegExp(`(?:([a-zA-Z-]+):(?!\\/))+`, 'g'),
};