@pixerate/editor 0.268.2 → 0.269.1

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.
Files changed (58) hide show
  1. package/dist/agent/index.cjs +27 -27
  2. package/dist/agent/index.js +1 -1
  3. package/dist/animation-editor/index.cjs +61 -61
  4. package/dist/animation-editor/index.js +5 -5
  5. package/dist/brushes/import/abr.d.cts +48 -0
  6. package/dist/brushes/import/abr.d.ts +48 -0
  7. package/dist/brushes/import/bplist.d.cts +24 -0
  8. package/dist/brushes/import/bplist.d.ts +24 -0
  9. package/dist/brushes/import/pack.d.cts +82 -0
  10. package/dist/brushes/import/pack.d.ts +82 -0
  11. package/dist/brushes/import/zip.d.cts +31 -0
  12. package/dist/brushes/import/zip.d.ts +31 -0
  13. package/dist/brushes/index.cjs +26 -6
  14. package/dist/brushes/index.d.cts +2 -0
  15. package/dist/brushes/index.d.ts +2 -0
  16. package/dist/brushes/index.js +22 -2
  17. package/dist/{chunk-SIFAIGB3.js → chunk-3AJCEJNH.js} +2 -162
  18. package/dist/{chunk-YXP6X3SY.cjs → chunk-3KNQ2W6X.cjs} +697 -10
  19. package/dist/{chunk-QNY7BDFP.js → chunk-4CPOKP27.js} +1 -1
  20. package/dist/{chunk-J4GXP53R.cjs → chunk-4NMPUJUK.cjs} +86 -86
  21. package/dist/{chunk-LDOD7VCT.js → chunk-4YSPQGZW.js} +1 -1
  22. package/dist/{chunk-JBB3GDBB.cjs → chunk-56RHCIJV.cjs} +2 -2
  23. package/dist/{chunk-4IMD2TLY.cjs → chunk-AI4F33IV.cjs} +3166 -2966
  24. package/dist/{chunk-YOVXQHA3.cjs → chunk-BENSE3VX.cjs} +23 -23
  25. package/dist/{chunk-VDGBHYC7.js → chunk-F7OO3DHP.js} +157 -1
  26. package/dist/{chunk-UVTO3D4E.js → chunk-FUDP5QBB.js} +1 -1
  27. package/dist/{chunk-3XDSNIGF.js → chunk-ININNHLM.js} +687 -0
  28. package/dist/{chunk-WIC7TG73.cjs → chunk-M4UQA2T4.cjs} +18 -18
  29. package/dist/{chunk-ITURMC2M.js → chunk-N3UMQVKX.js} +176 -176
  30. package/dist/{chunk-UWEQ55MY.cjs → chunk-N4KP3UQR.cjs} +157 -1
  31. package/dist/{chunk-D5BXSOSU.js → chunk-QGVTOCNB.js} +3118 -2918
  32. package/dist/{chunk-M6DNZNVY.js → chunk-RWDSSK2I.js} +4 -2
  33. package/dist/{chunk-CVFAAZXE.cjs → chunk-SPIO2GJU.cjs} +8 -6
  34. package/dist/{chunk-RHEMMGCN.cjs → chunk-T4JPGBW3.cjs} +173 -173
  35. package/dist/{chunk-HFY5LG5J.js → chunk-THBJHPUL.js} +1 -1
  36. package/dist/{chunk-NPWWSCWT.cjs → chunk-VBRHE4AM.cjs} +35 -35
  37. package/dist/{chunk-AZC2NDAR.js → chunk-WB22XMW3.js} +6 -6
  38. package/dist/{chunk-NIBFDFYW.cjs → chunk-YBMUHIOM.cjs} +12 -172
  39. package/dist/extensions/index.cjs +18 -4
  40. package/dist/extensions/index.d.cts +1 -0
  41. package/dist/extensions/index.d.ts +1 -0
  42. package/dist/extensions/index.js +17 -3
  43. package/dist/extensions/prompt-editor.d.cts +109 -0
  44. package/dist/extensions/prompt-editor.d.ts +109 -0
  45. package/dist/generation/index.cjs +15 -15
  46. package/dist/generation/index.js +3 -3
  47. package/dist/grammar/index.cjs +4 -4
  48. package/dist/grammar/index.js +7 -7
  49. package/dist/image-editor/index.cjs +785 -785
  50. package/dist/image-editor/index.js +6 -6
  51. package/dist/index.cjs +27 -13
  52. package/dist/index.js +23 -9
  53. package/dist/paint-editor/index.cjs +91 -91
  54. package/dist/paint-editor/index.js +6 -6
  55. package/dist/vector/index.cjs +1001 -1001
  56. package/dist/vector/index.js +6 -6
  57. package/package.json +1 -1
  58. package/skills/pixerate-image-selection-masking/SKILL.md +8 -8
@@ -1,165 +1,8 @@
1
1
  import {
2
- INSTRUCTION_REGEX,
3
- TEMPLATE_REGEX,
4
- VARIABLE_REGEX,
5
2
  evaluateCondition,
6
3
  getSuppliedValue,
7
- matchConditionalTags,
8
- parseVariableBody
9
- } from "./chunk-VDGBHYC7.js";
10
-
11
- // src/grammar/tokenizer.ts
12
- function tokenizePrompt(text) {
13
- return tokenizePromptWithDiagnostics(text).tokens;
14
- }
15
- function getPromptDiagnostics(text) {
16
- return tokenizePromptWithDiagnostics(text).diagnostics;
17
- }
18
- function tokenizePromptWithDiagnostics(text) {
19
- if (!text) {
20
- return { tokens: [], diagnostics: [] };
21
- }
22
- const rawMatches = [];
23
- const tmplRegex = new RegExp(TEMPLATE_REGEX.source, TEMPLATE_REGEX.flags);
24
- let match;
25
- while ((match = tmplRegex.exec(text)) !== null) {
26
- rawMatches.push({
27
- type: "template",
28
- raw: match[0],
29
- value: match[1].trim(),
30
- start: match.index,
31
- end: match.index + match[0].length
32
- });
33
- }
34
- const varRegex = new RegExp(VARIABLE_REGEX.source, VARIABLE_REGEX.flags);
35
- while ((match = varRegex.exec(text)) !== null) {
36
- const start = match.index;
37
- const end = start + match[0].length;
38
- const overlaps = rawMatches.some(
39
- (m) => !(end <= m.start || start >= m.end)
40
- );
41
- if (!overlaps) {
42
- const parsed = parseVariableBody(match[1]);
43
- if (parsed.kind === "conditional") {
44
- rawMatches.push({
45
- type: "conditional",
46
- raw: match[0],
47
- value: parsed.name,
48
- start,
49
- end,
50
- conditional: parsed.conditional
51
- });
52
- } else {
53
- const token = {
54
- type: "variable",
55
- raw: match[0],
56
- value: parsed.name,
57
- start,
58
- end
59
- };
60
- if (parsed.defaultValue !== void 0) {
61
- token.defaultValue = parsed.defaultValue;
62
- }
63
- if (parsed.description !== void 0) {
64
- token.description = parsed.description;
65
- }
66
- rawMatches.push(token);
67
- }
68
- }
69
- }
70
- const instRegex = new RegExp(
71
- INSTRUCTION_REGEX.source,
72
- INSTRUCTION_REGEX.flags
73
- );
74
- while ((match = instRegex.exec(text)) !== null) {
75
- const start = match.index;
76
- const end = start + match[0].length;
77
- const overlaps = rawMatches.some(
78
- (m) => !(end <= m.start || start >= m.end)
79
- );
80
- if (!overlaps) {
81
- rawMatches.push({
82
- type: "instruction",
83
- raw: match[0],
84
- value: match[1].trim(),
85
- start,
86
- end
87
- });
88
- }
89
- }
90
- rawMatches.sort((a, b) => a.start - b.start);
91
- const diagnostics = [];
92
- const literal = /* @__PURE__ */ new Set();
93
- const conditionals = rawMatches.filter(
94
- (m) => m.type === "conditional"
95
- );
96
- matchConditionalTags(
97
- conditionals.map((m) => ({ conditional: m.conditional, name: m.value }))
98
- ).forEach((result, i) => {
99
- const tag = conditionals[i];
100
- const parsed = result.comparison;
101
- if (!result.error) {
102
- if (parsed?.comparison && tag.conditional !== "end") {
103
- tag.value = parsed.subject;
104
- tag.comparison = parsed.comparison;
105
- }
106
- return;
107
- }
108
- literal.add(tag);
109
- if (result.error === "invalid-condition") {
110
- if (tag.conditional === "end") return;
111
- diagnostics.push({
112
- code: result.error,
113
- message: `Invalid condition "${tag.raw}": ${parsed?.error ?? "malformed comparison"}`,
114
- name: parsed?.subject ?? tag.value,
115
- start: tag.start,
116
- end: tag.end
117
- });
118
- return;
119
- }
120
- diagnostics.push({
121
- code: result.error,
122
- message: result.error === "unclosed-section" ? `Section "${tag.raw}" is never closed with "{/${tag.value}}"` : `"${tag.raw}" does not close any open section`,
123
- name: tag.value,
124
- start: tag.start,
125
- end: tag.end
126
- });
127
- });
128
- diagnostics.sort((a, b) => a.start - b.start);
129
- const tokens = [];
130
- let currentIdx = 0;
131
- const pushText = (start, end) => {
132
- const previous = tokens[tokens.length - 1];
133
- if (previous?.type === "text" && previous.end === start) {
134
- previous.raw = previous.value = text.slice(previous.start, end);
135
- previous.end = end;
136
- return;
137
- }
138
- const textChunk = text.slice(start, end);
139
- tokens.push({
140
- type: "text",
141
- raw: textChunk,
142
- value: textChunk,
143
- start,
144
- end
145
- });
146
- };
147
- for (const m of rawMatches) {
148
- if (m.start > currentIdx) {
149
- pushText(currentIdx, m.start);
150
- }
151
- if (literal.has(m)) {
152
- pushText(m.start, m.end);
153
- } else {
154
- tokens.push({ ...m });
155
- }
156
- currentIdx = m.end;
157
- }
158
- if (currentIdx < text.length) {
159
- pushText(currentIdx, text.length);
160
- }
161
- return { tokens, diagnostics };
162
- }
4
+ tokenizePromptWithDiagnostics
5
+ } from "./chunk-F7OO3DHP.js";
163
6
 
164
7
  // src/grammar/engine.ts
165
8
  function getLatestVersion(template) {
@@ -388,9 +231,6 @@ function evaluatePromptTokens(text, values) {
388
231
  }
389
232
 
390
233
  export {
391
- tokenizePrompt,
392
- getPromptDiagnostics,
393
- tokenizePromptWithDiagnostics,
394
234
  getLatestVersion,
395
235
  TEMPLATE_LOOP_ERROR,
396
236
  TEMPLATE_DEPTH_ERROR,