@pixerate/editor 0.164.0 → 0.166.0

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 (146) hide show
  1. package/dist/agent/index.cjs +54 -39
  2. package/dist/agent/index.js +24 -9
  3. package/dist/animation/index.cjs +6 -5
  4. package/dist/animation/index.js +5 -4
  5. package/dist/animation-editor/index.cjs +65 -64
  6. package/dist/animation-editor/index.js +8 -7
  7. package/dist/bridge/cli.cjs +3 -3
  8. package/dist/bridge/cli.js +2 -2
  9. package/dist/bridge/index.cjs +3 -3
  10. package/dist/bridge/index.js +2 -2
  11. package/dist/canvas/index.cjs +89 -87
  12. package/dist/canvas/index.js +11 -9
  13. package/dist/chart/controller.d.cts +60 -2
  14. package/dist/chart/controller.d.ts +60 -2
  15. package/dist/chart/index.cjs +657 -163
  16. package/dist/chart/index.d.cts +3 -0
  17. package/dist/chart/index.d.ts +3 -0
  18. package/dist/chart/index.js +512 -18
  19. package/dist/chart/layout-families.d.cts +14 -0
  20. package/dist/chart/layout-families.d.ts +14 -0
  21. package/dist/chart/layout-shared.d.cts +5 -0
  22. package/dist/chart/layout-shared.d.ts +5 -0
  23. package/dist/chart/links.d.cts +34 -0
  24. package/dist/chart/links.d.ts +34 -0
  25. package/dist/chart/mermaid.d.cts +9 -6
  26. package/dist/chart/mermaid.d.ts +9 -6
  27. package/dist/chart/race.d.cts +26 -0
  28. package/dist/chart/race.d.ts +26 -0
  29. package/dist/chart/schemas.d.cts +5 -0
  30. package/dist/chart/schemas.d.ts +5 -0
  31. package/dist/chart/spec.d.cts +3 -2
  32. package/dist/chart/spec.d.ts +3 -2
  33. package/dist/chart/style.d.cts +33 -0
  34. package/dist/chart/style.d.ts +33 -0
  35. package/dist/chart/types.d.cts +28 -2
  36. package/dist/chart/types.d.ts +28 -2
  37. package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
  38. package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
  39. package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  40. package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
  41. package/dist/{chunk-5FNGLV2D.js → chunk-5UNQDC3Q.js} +18 -3
  42. package/dist/{chunk-YSAGBIRW.cjs → chunk-6FYIFGBW.cjs} +16 -16
  43. package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
  44. package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
  45. package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
  46. package/dist/{chunk-R3P2M7HU.cjs → chunk-BPX4Z3N3.cjs} +355 -207
  47. package/dist/{chunk-D54JHQK2.cjs → chunk-CHLV7UFP.cjs} +51 -51
  48. package/dist/{chunk-OXERWBKE.js → chunk-DFCAR7AW.js} +3 -3
  49. package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
  50. package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
  51. package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
  52. package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
  53. package/dist/{chunk-3NEZJCBY.js → chunk-FR432ROA.js} +349 -201
  54. package/dist/chunk-HIDFL5LQ.js +484 -0
  55. package/dist/{chunk-22KLZZGH.cjs → chunk-HXOBOHH2.cjs} +8 -8
  56. package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
  57. package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
  58. package/dist/{chunk-Z4P2RBMJ.js → chunk-ITANXMZD.js} +177 -3
  59. package/dist/chunk-KGRZMHZB.js +204 -0
  60. package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
  61. package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
  62. package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
  63. package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
  64. package/dist/{chunk-NZD2MZJC.cjs → chunk-MZFZSVUJ.cjs} +38 -23
  65. package/dist/{chunk-DAPQGA55.js → chunk-NQQDGGXY.js} +2 -2
  66. package/dist/chunk-O6OGNDND.js +164 -0
  67. package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
  68. package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
  69. package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
  70. package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
  71. package/dist/{chunk-YGG7WDWT.cjs → chunk-SZWVMB3B.cjs} +24 -18
  72. package/dist/chunk-TFF2GTGN.cjs +153 -0
  73. package/dist/chunk-TTCJPX4U.cjs +204 -0
  74. package/dist/{chunk-SBQVEBSU.cjs → chunk-UUUTEVX6.cjs} +242 -68
  75. package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
  76. package/dist/{chunk-GKNEJ6EN.cjs → chunk-V5L2G22R.cjs} +321 -107
  77. package/dist/{chunk-TALQONZ5.js → chunk-VB2CY6EG.js} +3 -3
  78. package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
  79. package/dist/chunk-VU6WQSMB.cjs +164 -0
  80. package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
  81. package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
  82. package/dist/{chunk-POR54B55.js → chunk-XNU45TYA.js} +7 -1
  83. package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
  84. package/dist/chunk-YBAPT7NL.js +153 -0
  85. package/dist/{chunk-SZA42R4N.js → chunk-YUFTVNLX.js} +230 -16
  86. package/dist/chunk-Z2UQYMPS.cjs +484 -0
  87. package/dist/color/index.cjs +5 -3
  88. package/dist/color/index.js +12 -10
  89. package/dist/diagram/index.cjs +55 -243
  90. package/dist/diagram/index.js +12 -200
  91. package/dist/export/index.cjs +7 -6
  92. package/dist/export/index.js +6 -5
  93. package/dist/extensions/index.cjs +12 -9
  94. package/dist/extensions/index.js +11 -8
  95. package/dist/gradient/index.cjs +29 -27
  96. package/dist/gradient/index.js +6 -4
  97. package/dist/image-editor/index.cjs +644 -643
  98. package/dist/image-editor/index.js +7 -6
  99. package/dist/index.cjs +21 -18
  100. package/dist/index.js +14 -11
  101. package/dist/paint-editor/index.cjs +19 -18
  102. package/dist/paint-editor/index.js +7 -6
  103. package/dist/parameters/index.cjs +2 -2
  104. package/dist/parameters/index.js +1 -1
  105. package/dist/persistence/assetWrites.d.cts +22 -0
  106. package/dist/persistence/assetWrites.d.ts +22 -0
  107. package/dist/persistence/assets.d.cts +71 -0
  108. package/dist/persistence/assets.d.ts +71 -0
  109. package/dist/persistence/documentStore.d.cts +17 -1
  110. package/dist/persistence/documentStore.d.ts +17 -1
  111. package/dist/persistence/documentTools.d.cts +5 -1
  112. package/dist/persistence/documentTools.d.ts +5 -1
  113. package/dist/persistence/editorAutosave.d.cts +7 -0
  114. package/dist/persistence/editorAutosave.d.ts +7 -0
  115. package/dist/persistence/index.cjs +141 -21
  116. package/dist/persistence/index.js +130 -10
  117. package/dist/persistence/storage.d.cts +13 -1
  118. package/dist/persistence/storage.d.ts +13 -1
  119. package/dist/spreadsheet/index.cjs +3 -3
  120. package/dist/spreadsheet/index.js +2 -2
  121. package/dist/tokens/index.cjs +11 -3
  122. package/dist/tokens/index.d.cts +1 -0
  123. package/dist/tokens/index.d.ts +1 -0
  124. package/dist/tokens/index.js +10 -2
  125. package/dist/tokens/style.d.cts +36 -0
  126. package/dist/tokens/style.d.ts +36 -0
  127. package/dist/tools/index.cjs +15 -3
  128. package/dist/tools/index.d.cts +2 -0
  129. package/dist/tools/index.d.ts +2 -0
  130. package/dist/tools/index.js +14 -2
  131. package/dist/tools/style-tools.d.cts +19 -0
  132. package/dist/tools/style-tools.d.ts +19 -0
  133. package/dist/tools/style.d.cts +212 -0
  134. package/dist/tools/style.d.ts +212 -0
  135. package/dist/tools/view.d.cts +6 -0
  136. package/dist/tools/view.d.ts +6 -0
  137. package/dist/typography/index.cjs +8 -6
  138. package/dist/typography/index.js +5 -3
  139. package/dist/vector/index.cjs +953 -952
  140. package/dist/vector/index.js +7 -6
  141. package/dist/video-editor/index.cjs +8 -7
  142. package/dist/video-editor/index.js +6 -5
  143. package/package.json +1 -1
  144. package/skills/pixerate-chart/SKILL.md +20 -2
  145. package/dist/chunk-ERAGQL2N.cjs +0 -68
  146. package/dist/chunk-KMU6QJB7.js +0 -68
@@ -1,14 +1,18 @@
1
1
  import {
2
- contrastLevel,
3
- contrastRatio,
4
2
  deltaEOK,
5
3
  formatColor,
6
4
  formatHex,
5
+ inSrgbGamut,
6
+ normalizeColor,
7
+ suggestAccessibleForeground,
8
+ toSrgbGamut
9
+ } from "./chunk-YBAPT7NL.js";
10
+ import {
11
+ contrastLevel,
12
+ contrastRatio,
7
13
  hslToRgb,
8
14
  hsvToRgb,
9
- inSrgbGamut,
10
15
  linearToSrgb,
11
- normalizeColor,
12
16
  oklabToOklch,
13
17
  oklabToRgb,
14
18
  oklchToOklab,
@@ -17,10 +21,8 @@ import {
17
21
  rgbToHsl,
18
22
  rgbToHsv,
19
23
  rgbToOklab,
20
- srgbToLinear,
21
- suggestAccessibleForeground,
22
- toSrgbGamut
23
- } from "./chunk-4VU4CP7R.js";
24
+ srgbToLinear
25
+ } from "./chunk-MHLU6GRJ.js";
24
26
 
25
27
  // src/color/vision.ts
26
28
  var CVD = {
@@ -253,6 +253,12 @@ var ToolRegistryView = (_class = class {
253
253
  return set.tools.some((t) => this.enabledTools.has(t)) ? "some" : "none";
254
254
  };
255
255
  const listedCount = () => this.listed(this.catalogue()).length;
256
+ const styleOf = async (set) => {
257
+ const domain = _optionalChain([set, 'access', _13 => _13.skill, 'optionalAccess', _14 => _14.replace, 'call', _15 => _15(/^pixerate-/, "")]);
258
+ if (!discovery.styles || !domain || !discovery.styles.domains.some((d) => d.id === domain)) return void 0;
259
+ const style = await discovery.styles.resolve(domain);
260
+ return style.skills.length ? { domain, skills: style.skills.length, layers: [...new Set(style.skills.map((s) => s.layer))] } : void 0;
261
+ };
256
262
  const tools = [
257
263
  {
258
264
  name: "list_toolsets",
@@ -260,16 +266,18 @@ var ToolRegistryView = (_class = class {
260
266
  description: "Lists the groups of editor tools available here (one per open editor or feature): name, title, what it covers, its agent skill, how many tools it has and whether they are in your tool list (`enabled`: all, some or none). Start here, then call search_tools or enable_tools.",
261
267
  annotations: READ_ONLY,
262
268
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
263
- handler: () => {
269
+ handler: async () => {
264
270
  const cat = this.catalogue();
271
+ const styles = await Promise.all(cat.sets.map(styleOf));
265
272
  return {
266
- toolsets: cat.sets.map((set) => ({
273
+ toolsets: cat.sets.map((set, i) => ({
267
274
  name: set.name,
268
275
  ...set.title ? { title: set.title } : {},
269
276
  ...set.description ? { description: set.description } : {},
270
277
  ...set.skill ? { skill: set.skill } : {},
271
278
  tools: set.tools.length,
272
- enabled: enabledState(set)
279
+ enabled: enabledState(set),
280
+ ...styles[i] ? { style: styles[i] } : {}
273
281
  })),
274
282
  ...skills.length > 0 ? { skills: skills.map((s) => s.name) } : {}
275
283
  };
@@ -312,9 +320,12 @@ var ToolRegistryView = (_class = class {
312
320
  description: "Adds tools to your tool list: single tools by name (from search_tools) and/or whole toolsets (from list_toolsets). Returns the names added and how many tools are listed now. Prefer single tools over large toolsets. Unknown names fail and change nothing.",
313
321
  annotations: LISTING,
314
322
  inputSchema: SELECTION_SCHEMA,
315
- handler: (args) => {
323
+ handler: async (args) => {
316
324
  const added = this.enableTools(args);
317
- return { added, listed: listedCount() };
325
+ const sets = this.catalogue().sets.filter((set) => set.tools.some((t) => added.includes(t)));
326
+ const domains = (await Promise.all(sets.map(styleOf))).filter((s) => s !== void 0).map((s) => s.domain);
327
+ const style = [...new Set(domains)].map((d) => `House style applies: call get_style with domain "${d}" before making changes.`);
328
+ return { added, listed: listedCount(), ...style.length ? { style } : {} };
318
329
  }
319
330
  },
320
331
  {
@@ -417,7 +428,7 @@ function toDefinition2(name, tool) {
417
428
  return { name, ...rest };
418
429
  }
419
430
  function errorResult(error) {
420
- const details = _optionalChain([error, 'access', _13 => _13.details, 'optionalAccess', _14 => _14.length]) ? "\n" + error.details.map((d) => `- ${d.path}: ${d.message}`).join("\n") : "";
431
+ const details = _optionalChain([error, 'access', _16 => _16.details, 'optionalAccess', _17 => _17.length]) ? "\n" + error.details.map((d) => `- ${d.path}: ${d.message}`).join("\n") : "";
421
432
  return {
422
433
  isError: true,
423
434
  content: [{ type: "text", text: `${error.message}${details}` }],
@@ -499,7 +510,7 @@ var ToolRegistry = (_class2 = class {
499
510
  );
500
511
  if (index === -1) return false;
501
512
  const [entry] = this.entries.splice(index, 1);
502
- _optionalChain([entry, 'access', _15 => _15.unsubscribe, 'optionalCall', _16 => _16()]);
513
+ _optionalChain([entry, 'access', _18 => _18.unsubscribe, 'optionalCall', _19 => _19()]);
503
514
  this.notifyListChanged();
504
515
  return true;
505
516
  }
@@ -680,7 +691,7 @@ var ToolRegistry = (_class2 = class {
680
691
  dispose() {
681
692
  if (this.timer !== null) clearTimeout(this.timer);
682
693
  this.timer = null;
683
- for (const entry of this.entries.splice(0)) _optionalChain([entry, 'access', _17 => _17.unsubscribe, 'optionalCall', _18 => _18()]);
694
+ for (const entry of this.entries.splice(0)) _optionalChain([entry, 'access', _20 => _20.unsubscribe, 'optionalCall', _21 => _21()]);
684
695
  this.listeners.clear();
685
696
  }
686
697
  }, _class2);
@@ -791,7 +802,7 @@ function paramText(schema, depth = 0) {
791
802
  function document(tool, toolset) {
792
803
  const fields = {
793
804
  name: new Set(searchTokens(baseToolName(tool.name))),
794
- title: new Set(searchTokens(_nullishCoalesce(_nullishCoalesce(tool.title, () => ( _optionalChain([tool, 'access', _19 => _19.annotations, 'optionalAccess', _20 => _20.title]))), () => ( "")))),
805
+ title: new Set(searchTokens(_nullishCoalesce(_nullishCoalesce(tool.title, () => ( _optionalChain([tool, 'access', _22 => _22.annotations, 'optionalAccess', _23 => _23.title]))), () => ( "")))),
795
806
  toolset: new Set(searchTokens(`${toolset.name} ${_nullishCoalesce(toolset.title, () => ( ""))} ${_nullishCoalesce(toolset.description, () => ( ""))}`)),
796
807
  description: new Set(searchTokens(_nullishCoalesce(tool.description, () => ( "")))),
797
808
  params: new Set(searchTokens(paramText(tool.inputSchema)))
@@ -859,7 +870,7 @@ function searchTools(tools, toolsets, query, options = {}) {
859
870
  toolset: doc.toolset.name,
860
871
  ...doc.tool.title ? { title: doc.tool.title } : {},
861
872
  summary: summarize(doc.tool.description),
862
- readOnly: _optionalChain([doc, 'access', _21 => _21.tool, 'access', _22 => _22.annotations, 'optionalAccess', _23 => _23.readOnlyHint]) === true,
873
+ readOnly: _optionalChain([doc, 'access', _24 => _24.tool, 'access', _25 => _25.annotations, 'optionalAccess', _26 => _26.readOnlyHint]) === true,
863
874
  score: Math.round(score * 100) / 100
864
875
  });
865
876
  }
@@ -911,7 +922,7 @@ function createMcpServer(registry, options) {
911
922
  ...registry.capabilities,
912
923
  ...skills.length > 0 ? { resources: {}, prompts: {} } : {}
913
924
  };
914
- const readSkillPath = (path) => _nullishCoalesce(_optionalChain([skillFiles, 'optionalAccess', _24 => _24[path]]), () => ( _optionalChain([skillFiles, 'optionalAccess', _25 => _25[`./${path}`]])));
925
+ const readSkillPath = (path) => _nullishCoalesce(_optionalChain([skillFiles, 'optionalAccess', _27 => _27[path]]), () => ( _optionalChain([skillFiles, 'optionalAccess', _28 => _28[`./${path}`]])));
915
926
  let initialized = false;
916
927
  let actor;
917
928
  let unsubscribe = null;
@@ -951,7 +962,7 @@ function createMcpServer(registry, options) {
951
962
  return null;
952
963
  case "notifications/cancelled": {
953
964
  const requestId = params.requestId;
954
- if (requestId !== void 0) _optionalChain([running, 'access', _26 => _26.get, 'call', _27 => _27(requestId), 'optionalAccess', _28 => _28.abort, 'call', _29 => _29(params.reason)]);
965
+ if (requestId !== void 0) _optionalChain([running, 'access', _29 => _29.get, 'call', _30 => _30(requestId), 'optionalAccess', _31 => _31.abort, 'call', _32 => _32(params.reason)]);
955
966
  return null;
956
967
  }
957
968
  case "ping":
@@ -1052,7 +1063,7 @@ function createMcpServer(registry, options) {
1052
1063
  }
1053
1064
  },
1054
1065
  close() {
1055
- _optionalChain([unsubscribe, 'optionalCall', _30 => _30()]);
1066
+ _optionalChain([unsubscribe, 'optionalCall', _33 => _33()]);
1056
1067
  unsubscribe = null;
1057
1068
  for (const controller of running.values()) controller.abort("Server closed.");
1058
1069
  running.clear();
@@ -1078,7 +1089,7 @@ function connectToolBridge(registry, options) {
1078
1089
  const setStatus = (next, detail) => {
1079
1090
  if (next === status && !detail) return;
1080
1091
  status = next;
1081
- _optionalChain([options, 'access', _31 => _31.onStatus, 'optionalCall', _32 => _32(next, detail)]);
1092
+ _optionalChain([options, 'access', _34 => _34.onStatus, 'optionalCall', _35 => _35(next, detail)]);
1082
1093
  };
1083
1094
  const send = (message) => {
1084
1095
  if (socket && socket.readyState === 1) socket.send(JSON.stringify(message));
@@ -1111,7 +1122,7 @@ function connectToolBridge(registry, options) {
1111
1122
  if (!controller.signal.aborted) send({ t: "result", id: message.id, result });
1112
1123
  });
1113
1124
  } else if (message.t === "cancel") {
1114
- _optionalChain([running, 'access', _33 => _33.get, 'call', _34 => _34(message.id), 'optionalAccess', _35 => _35.abort, 'call', _36 => _36(_nullishCoalesce(message.reason, () => ( "Cancelled by the agent.")))]);
1125
+ _optionalChain([running, 'access', _36 => _36.get, 'call', _37 => _37(message.id), 'optionalAccess', _38 => _38.abort, 'call', _39 => _39(_nullishCoalesce(message.reason, () => ( "Cancelled by the agent.")))]);
1115
1126
  running.delete(message.id);
1116
1127
  }
1117
1128
  });
@@ -1147,7 +1158,7 @@ function connectToolBridge(registry, options) {
1147
1158
  running.clear();
1148
1159
  const ws = socket;
1149
1160
  socket = null;
1150
- _optionalChain([ws, 'optionalAccess', _37 => _37.close, 'call', _38 => _38(1e3, "Editor closed.")]);
1161
+ _optionalChain([ws, 'optionalAccess', _40 => _40.close, 'call', _41 => _41(1e3, "Editor closed.")]);
1151
1162
  setStatus("closed");
1152
1163
  }
1153
1164
  };
@@ -89,7 +89,7 @@ import {
89
89
  textRectPath,
90
90
  translateMatrix,
91
91
  warpPresetMesh
92
- } from "./chunk-SET6KJOP.js";
92
+ } from "./chunk-LPIKXPBM.js";
93
93
  import {
94
94
  bezierPathBounds,
95
95
  outlineStroke,