@useinsider/ab-components 0.0.116 → 0.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ab-components.cjs.js +88 -87
- package/dist/ab-components.cjs.js.map +1 -1
- package/dist/ab-components.es.js +34 -5129
- package/dist/ab-components.es.js.map +1 -1
- package/dist/ab-components.iife.js +88 -87
- package/dist/ab-components.iife.js.map +1 -1
- package/dist/ab-components.umd.js +88 -87
- package/dist/ab-components.umd.js.map +1 -1
- package/dist/index-fSNS57rB.js +8666 -0
- package/dist/index-fSNS57rB.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/liquid-DHPHtfpJ.js +152 -0
- package/dist/liquid-DHPHtfpJ.js.map +1 -0
- package/package.json +1 -1
- package/dist/liquid-hNC9E8-o.js +0 -3665
- package/dist/liquid-hNC9E8-o.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -822,6 +822,23 @@ declare interface DropdownProps {
|
|
|
822
822
|
validateAddItem?: (item: string, items: MenuItem_2[]) => string | null;
|
|
823
823
|
}
|
|
824
824
|
|
|
825
|
+
/**
|
|
826
|
+
* External (global) variables referenced by `{{ }}` / `{% %}` in a Liquid
|
|
827
|
+
* snippet, as full dotted paths (e.g. `e_purchase.amount`), de-duplicated.
|
|
828
|
+
*
|
|
829
|
+
* Uses liquidjs static analysis: the returned set is the `globals` — references
|
|
830
|
+
* that are NOT in scope. This excludes, with no hand-rolled lists:
|
|
831
|
+
* - `{% assign %}` / `{% capture %}` targets
|
|
832
|
+
* - `{% for %}` / `{% tablerow %}` loop variables
|
|
833
|
+
* - the loop-provided `forloop` / `tablerowloop` objects
|
|
834
|
+
* - `{% increment %}` / `{% decrement %}` counters
|
|
835
|
+
* - string / number literals and filter names
|
|
836
|
+
*
|
|
837
|
+
* Returns `[]` for empty input or syntactically invalid Liquid (e.g. while the
|
|
838
|
+
* user is mid-typing), so callers never have to guard against a thrown parse.
|
|
839
|
+
*/
|
|
840
|
+
export declare function getLiquidVariables(code: string): string[];
|
|
841
|
+
|
|
825
842
|
export declare const Icon: DefineComponent<IconProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IconProps> & Readonly<{}>, {
|
|
826
843
|
size: number | string;
|
|
827
844
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { L as f } from "./index-fSNS57rB.js";
|
|
2
|
+
const g = new f(), h = /* @__PURE__ */ new Set(["if", "unless", "for", "case", "capture", "comment", "raw", "tablerow"]), w = {
|
|
3
|
+
endif: "if",
|
|
4
|
+
endunless: "unless",
|
|
5
|
+
endfor: "for",
|
|
6
|
+
endcase: "case",
|
|
7
|
+
endcapture: "capture",
|
|
8
|
+
endcomment: "comment",
|
|
9
|
+
endraw: "raw",
|
|
10
|
+
endtablerow: "tablerow"
|
|
11
|
+
};
|
|
12
|
+
function u(t, s) {
|
|
13
|
+
let i = 1, o = -1;
|
|
14
|
+
for (let e = 0; e < s; e += 1)
|
|
15
|
+
t[e] === `
|
|
16
|
+
` && (i += 1, o = e);
|
|
17
|
+
return { line: i, column: s - o };
|
|
18
|
+
}
|
|
19
|
+
function x(t) {
|
|
20
|
+
const s = [], i = [], o = /\{\{|\}\}|\{%|%\}/g;
|
|
21
|
+
let e = null, c = -1, r = null, n = o.exec(t);
|
|
22
|
+
for (; n !== null; ) {
|
|
23
|
+
const l = n[0];
|
|
24
|
+
if (l === "{{" || l === "{%") {
|
|
25
|
+
if (e) {
|
|
26
|
+
const d = u(t, c);
|
|
27
|
+
s.push({ ...d, message: `Unclosed ${e} — '${e === "{{" ? "}}" : "%}"}' expected.` });
|
|
28
|
+
}
|
|
29
|
+
e = l, c = n.index;
|
|
30
|
+
} else if (e) {
|
|
31
|
+
const d = e === "{{" ? "}}" : "%}";
|
|
32
|
+
if (l !== d) {
|
|
33
|
+
const a = u(t, c);
|
|
34
|
+
s.push({ ...a, message: `Mismatched delimiter — '${d}' expected.` });
|
|
35
|
+
} else if (e === "{%") {
|
|
36
|
+
const a = t.slice(c + 2, n.index).trim().split(/\s+/)[0] ?? "";
|
|
37
|
+
if (r)
|
|
38
|
+
a === `end${r}` && (i.pop(), r = null);
|
|
39
|
+
else if (h.has(a))
|
|
40
|
+
i.push({ tag: a, index: c }), (a === "comment" || a === "raw") && (r = a);
|
|
41
|
+
else {
|
|
42
|
+
const m = w[a];
|
|
43
|
+
if (m)
|
|
44
|
+
if (i.length > 0 && i[i.length - 1].tag === m)
|
|
45
|
+
i.pop();
|
|
46
|
+
else {
|
|
47
|
+
const p = u(t, c);
|
|
48
|
+
s.push({ ...p, message: `Unexpected {% ${a} %}.` });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
e = null, c = -1;
|
|
53
|
+
}
|
|
54
|
+
n = o.exec(t);
|
|
55
|
+
}
|
|
56
|
+
if (e) {
|
|
57
|
+
const l = u(t, c);
|
|
58
|
+
s.push({ ...l, message: `Unclosed ${e}.` });
|
|
59
|
+
}
|
|
60
|
+
return i.forEach((l) => {
|
|
61
|
+
const d = u(t, l.index);
|
|
62
|
+
s.push({ ...d, message: `Unclosed {% ${l.tag} %} — '{% end${l.tag} %}' missing.` });
|
|
63
|
+
}), s;
|
|
64
|
+
}
|
|
65
|
+
const k = /* @__PURE__ */ new Set(["true", "false", "nil", "null", "empty", "blank", "forloop", "tablerowloop"]);
|
|
66
|
+
function b(t) {
|
|
67
|
+
const s = /* @__PURE__ */ new Set(), i = /\{%-?\s*(?:assign|capture)\s+([a-zA-Z_]\w*)/g, o = /\{%-?\s*(?:for|tablerow)\s+([a-zA-Z_]\w*)\s+in\b/g;
|
|
68
|
+
let e = i.exec(t);
|
|
69
|
+
for (; e !== null; )
|
|
70
|
+
s.add(e[1]), e = i.exec(t);
|
|
71
|
+
for (e = o.exec(t); e !== null; )
|
|
72
|
+
s.add(e[1]), e = o.exec(t);
|
|
73
|
+
return s;
|
|
74
|
+
}
|
|
75
|
+
function S(t, s) {
|
|
76
|
+
var r;
|
|
77
|
+
const i = [], o = new Set(k);
|
|
78
|
+
s.forEach((n) => {
|
|
79
|
+
o.add(n);
|
|
80
|
+
const [l] = n.split(".");
|
|
81
|
+
l && o.add(l);
|
|
82
|
+
}), b(t).forEach((n) => o.add(n));
|
|
83
|
+
const e = /\{\{-?([\s\S]*?)-?\}\}/g;
|
|
84
|
+
let c = e.exec(t);
|
|
85
|
+
for (; c !== null; ) {
|
|
86
|
+
const l = (r = (c[1].split("|")[0] ?? "").trim().match(/^[a-zA-Z_][\w.]*/)) == null ? void 0 : r[0];
|
|
87
|
+
if (l) {
|
|
88
|
+
const [d] = l.split(".");
|
|
89
|
+
!o.has(l) && !o.has(d) && i.push({ ...u(t, c.index), message: `Unknown dynamic content variable: ${l}` });
|
|
90
|
+
}
|
|
91
|
+
c = e.exec(t);
|
|
92
|
+
}
|
|
93
|
+
return i;
|
|
94
|
+
}
|
|
95
|
+
function L(t) {
|
|
96
|
+
const s = t == null ? void 0 : t.token;
|
|
97
|
+
if (s && typeof s.getPosition == "function") {
|
|
98
|
+
const [e, c] = s.getPosition();
|
|
99
|
+
return { line: e || 1, column: c || 1 };
|
|
100
|
+
}
|
|
101
|
+
const o = ((t == null ? void 0 : t.message) ?? "").match(/line:(\d+),\s*col:(\d+)/);
|
|
102
|
+
return o ? { line: Number(o[1]), column: Number(o[2]) } : { line: 1, column: 1 };
|
|
103
|
+
}
|
|
104
|
+
const E = (t, s, i = []) => {
|
|
105
|
+
const o = t.getModel();
|
|
106
|
+
if (!o)
|
|
107
|
+
return {
|
|
108
|
+
valid: !0,
|
|
109
|
+
results: []
|
|
110
|
+
};
|
|
111
|
+
const e = t.getValue(), c = (n) => ({
|
|
112
|
+
startLineNumber: n.line,
|
|
113
|
+
endLineNumber: n.line,
|
|
114
|
+
startColumn: n.column,
|
|
115
|
+
endColumn: n.column + 1,
|
|
116
|
+
message: n.message,
|
|
117
|
+
severity: s.MarkerSeverity.Error
|
|
118
|
+
}), r = [
|
|
119
|
+
...x(e),
|
|
120
|
+
...i.length > 0 ? S(e, i) : []
|
|
121
|
+
];
|
|
122
|
+
if (r.length > 0) {
|
|
123
|
+
const n = r.map(c);
|
|
124
|
+
return s.editor.setModelMarkers(o, "owner", n), {
|
|
125
|
+
valid: !1,
|
|
126
|
+
results: n
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
return g.parse(e), s.editor.setModelMarkers(o, "owner", []), {
|
|
131
|
+
valid: !0,
|
|
132
|
+
results: []
|
|
133
|
+
};
|
|
134
|
+
} catch (n) {
|
|
135
|
+
const l = c({
|
|
136
|
+
...L(n),
|
|
137
|
+
message: (n == null ? void 0 : n.message) ?? "Invalid Liquid syntax"
|
|
138
|
+
});
|
|
139
|
+
return s.editor.setModelMarkers(o, "owner", [l]), {
|
|
140
|
+
valid: !1,
|
|
141
|
+
results: [l]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
export {
|
|
146
|
+
b as collectLocalVariables,
|
|
147
|
+
E as default,
|
|
148
|
+
x as findStructuralErrors,
|
|
149
|
+
S as findUnknownVariables,
|
|
150
|
+
u as positionAt
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=liquid-DHPHtfpJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid-DHPHtfpJ.js","sources":["../src/components/MonacoEditor/validators/liquid.ts"],"sourcesContent":["// cspell:ignore liquidjs endunless endcapture endcomment endraw tablerow endtablerow elsif forloop tablerowloop\nimport type { editor as Editor } from 'monaco-editor';\nimport { Liquid } from 'liquidjs';\n\n// Parse-only engine: validates Liquid syntax, mirroring the liquid.js grammar\n// Pandora renders with. Used as a fallback for expression/filter errors that the\n// structural scan below doesn't cover. Undefined variables/filters are NOT errors\n// here — those only surface server-side at render time.\nconst engine = new Liquid();\n\ninterface LiquidErrorInfo {\n line: number;\n column: number;\n message: string;\n}\n\ninterface LiquidLikeError {\n message?: string;\n token?: { getPosition?: () => [number, number] };\n}\n\n// Block tags that must be closed by a matching `end<tag>`.\nconst BLOCK_OPENERS = new Set(['if', 'unless', 'for', 'case', 'capture', 'comment', 'raw', 'tablerow']);\nconst BLOCK_CLOSERS: Record<string, string> = {\n endif: 'if',\n endunless: 'unless',\n endfor: 'for',\n endcase: 'case',\n endcapture: 'capture',\n endcomment: 'comment',\n endraw: 'raw',\n endtablerow: 'tablerow',\n};\n\nexport function positionAt(value: string, index: number): { line: number; column: number } {\n let line = 1;\n let lastBreak = -1;\n\n for (let i = 0; i < index; i += 1) {\n if (value[i] === '\\n') {\n line += 1;\n lastBreak = i;\n }\n }\n\n return { line, column: index - lastBreak };\n}\n\n/**\n * Structural scan reporting EVERY broken delimiter and unbalanced block tag, so\n * each faulty line gets its own marker. `liquidjs.parse` only throws on the\n * first error, which is why we can't rely on it for multi-error highlighting.\n */\nexport function findStructuralErrors(value: string): LiquidErrorInfo[] {\n const errors: LiquidErrorInfo[] = [];\n const blockStack: { tag: string; index: number }[] = [];\n const delimiters = /\\{\\{|\\}\\}|\\{%|%\\}/g;\n\n let openType: '{{' | '{%' | null = null;\n let openIndex = -1;\n // While inside `{% comment %}`/`{% raw %}`, ignore inner block tags.\n let rawBlock: string | null = null;\n let match = delimiters.exec(value);\n\n while (match !== null) {\n const token = match[0];\n\n if (token === '{{' || token === '{%') {\n if (openType) {\n const pos = positionAt(value, openIndex);\n\n errors.push({ ...pos, message: `Unclosed ${openType} — '${openType === '{{' ? '}}' : '%}'}' expected.` });\n }\n\n openType = token;\n openIndex = match.index;\n } else if (openType) {\n const expected = openType === '{{' ? '}}' : '%}';\n\n if (token !== expected) {\n const pos = positionAt(value, openIndex);\n\n errors.push({ ...pos, message: `Mismatched delimiter — '${expected}' expected.` });\n } else if (openType === '{%') {\n const word = value.slice(openIndex + 2, match.index).trim().split(/\\s+/)[0] ?? '';\n\n if (rawBlock) {\n if (word === `end${rawBlock}`) {\n blockStack.pop();\n rawBlock = null;\n }\n } else if (BLOCK_OPENERS.has(word)) {\n blockStack.push({ tag: word, index: openIndex });\n\n if (word === 'comment' || word === 'raw') {\n rawBlock = word;\n }\n } else {\n const opener = BLOCK_CLOSERS[word];\n\n if (opener) {\n if (blockStack.length > 0 && blockStack[blockStack.length - 1].tag === opener) {\n blockStack.pop();\n } else {\n const pos = positionAt(value, openIndex);\n\n errors.push({ ...pos, message: `Unexpected {% ${word} %}.` });\n }\n }\n }\n }\n\n openType = null;\n openIndex = -1;\n }\n\n match = delimiters.exec(value);\n }\n\n if (openType) {\n const pos = positionAt(value, openIndex);\n\n errors.push({ ...pos, message: `Unclosed ${openType}.` });\n }\n\n blockStack.forEach(block => {\n const pos = positionAt(value, block.index);\n\n errors.push({ ...pos, message: `Unclosed {% ${block.tag} %} — '{% end${block.tag} %}' missing.` });\n });\n\n return errors;\n}\n\n// Liquid built-ins / literals that are valid inside `{{ }}` without being a\n// dynamic-content variable or a locally-assigned one.\nconst BUILTIN_VARS = new Set(['true', 'false', 'nil', 'null', 'empty', 'blank', 'forloop', 'tablerowloop']);\n\n// Variables introduced locally by the template itself (so they're not \"unknown\").\nexport function collectLocalVariables(value: string): Set<string> {\n const locals = new Set<string>();\n const assignRe = /\\{%-?\\s*(?:assign|capture)\\s+([a-zA-Z_]\\w*)/g;\n const loopRe = /\\{%-?\\s*(?:for|tablerow)\\s+([a-zA-Z_]\\w*)\\s+in\\b/g;\n\n let match = assignRe.exec(value);\n\n while (match !== null) {\n locals.add(match[1]);\n match = assignRe.exec(value);\n }\n\n match = loopRe.exec(value);\n\n while (match !== null) {\n locals.add(match[1]);\n match = loopRe.exec(value);\n }\n\n return locals;\n}\n\n/**\n * Flags `{{ output }}` whose variable is neither a known dynamic-content key, a\n * locally-assigned variable, nor a built-in/literal. Skipped entirely when no\n * known keys are supplied (e.g. the dynamic-content list hasn't loaded yet), to\n * avoid false positives.\n */\nexport function findUnknownVariables(value: string, knownKeys: string[]): LiquidErrorInfo[] {\n const errors: LiquidErrorInfo[] = [];\n const known = new Set<string>(BUILTIN_VARS);\n\n knownKeys.forEach(key => {\n known.add(key);\n\n const [root] = key.split('.');\n\n if (root) {\n known.add(root);\n }\n });\n\n collectLocalVariables(value).forEach(local => known.add(local));\n\n const outputRe = /\\{\\{-?([\\s\\S]*?)-?\\}\\}/g;\n let match = outputRe.exec(value);\n\n while (match !== null) {\n const expression = (match[1].split('|')[0] ?? '').trim();\n const token = expression.match(/^[a-zA-Z_][\\w.]*/)?.[0];\n\n if (token) {\n const [root] = token.split('.');\n\n if (!known.has(token) && !known.has(root)) {\n errors.push({ ...positionAt(value, match.index), message: `Unknown dynamic content variable: ${token}` });\n }\n }\n\n match = outputRe.exec(value);\n }\n\n return errors;\n}\n\nfunction getEnginePosition(error: unknown): { line: number; column: number } {\n const token = (error as LiquidLikeError)?.token;\n\n if (token && typeof token.getPosition === 'function') {\n const [line, column] = token.getPosition();\n\n return { line: line || 1, column: column || 1 };\n }\n\n const message = (error as LiquidLikeError)?.message ?? '';\n const match = message.match(/line:(\\d+),\\s*col:(\\d+)/);\n\n if (match) {\n return { line: Number(match[1]), column: Number(match[2]) };\n }\n\n return { line: 1, column: 1 };\n}\n\nconst liquidValidator = (\n editor: Editor.IStandaloneCodeEditor,\n monaco: typeof import('monaco-editor/esm/vs/editor/editor.api'),\n knownKeys: string[] = []\n) => {\n const model = editor.getModel();\n\n if (!model) {\n return {\n valid: true,\n results: [],\n };\n }\n\n const value = editor.getValue();\n const toMarker = (info: LiquidErrorInfo): Editor.IMarkerData => ({\n startLineNumber: info.line,\n endLineNumber: info.line,\n startColumn: info.column,\n endColumn: info.column + 1,\n message: info.message,\n severity: monaco.MarkerSeverity.Error,\n });\n\n // 1. Structural scan + unknown-variable scan — one marker per broken line.\n const structural = [\n ...findStructuralErrors(value),\n ...(knownKeys.length > 0 ? findUnknownVariables(value, knownKeys) : []),\n ];\n\n if (structural.length > 0) {\n const markers = structural.map(toMarker);\n\n monaco.editor.setModelMarkers(model, 'owner', markers);\n\n return {\n valid: false,\n results: markers,\n };\n }\n\n // 2. Fallback: liquidjs catches expression/filter errors (single error).\n try {\n engine.parse(value);\n\n monaco.editor.setModelMarkers(model, 'owner', []);\n\n return {\n valid: true,\n results: [],\n };\n } catch (error) {\n const marker = toMarker({\n ...getEnginePosition(error),\n message: (error as LiquidLikeError)?.message ?? 'Invalid Liquid syntax',\n });\n\n monaco.editor.setModelMarkers(model, 'owner', [marker]);\n\n return {\n valid: false,\n results: [marker],\n };\n }\n};\n\nexport default liquidValidator;\n"],"names":["engine","Liquid","BLOCK_OPENERS","BLOCK_CLOSERS","positionAt","value","index","line","lastBreak","i","findStructuralErrors","errors","blockStack","delimiters","openType","openIndex","rawBlock","match","token","pos","expected","word","opener","block","BUILTIN_VARS","collectLocalVariables","locals","assignRe","loopRe","findUnknownVariables","knownKeys","known","key","root","local","outputRe","_a","getEnginePosition","error","column","liquidValidator","editor","monaco","model","toMarker","info","structural","markers","marker"],"mappings":";AAQA,MAAMA,IAAS,IAAIC,EAAA,GAcbC,IAAgB,oBAAI,IAAI,CAAC,MAAM,UAAU,OAAO,QAAQ,WAAW,WAAW,OAAO,UAAU,CAAC,GAChGC,IAAwC;AAAA,EAC1C,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AACjB;AAEO,SAASC,EAAWC,GAAeC,GAAiD;AACvF,MAAIC,IAAO,GACPC,IAAY;AAEhB,WAASC,IAAI,GAAGA,IAAIH,GAAOG,KAAK;AAC5B,IAAIJ,EAAMI,CAAC,MAAM;AAAA,MACbF,KAAQ,GACRC,IAAYC;AAIpB,SAAO,EAAE,MAAAF,GAAM,QAAQD,IAAQE,EAAA;AACnC;AAOO,SAASE,EAAqBL,GAAkC;AACnE,QAAMM,IAA4B,CAAA,GAC5BC,IAA+C,CAAA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