@arbidocs/blocks 0.4.122 → 0.4.124

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 (123) hide show
  1. package/dist/{StreamedArtifactEditor-IZWYNFMM.cjs → StreamedArtifactEditor-DNBDUNP2.cjs} +5 -5
  2. package/dist/{StreamedArtifactEditor-IZWYNFMM.cjs.map → StreamedArtifactEditor-DNBDUNP2.cjs.map} +1 -1
  3. package/dist/{StreamedArtifactEditor-HTNPG4NB.js → StreamedArtifactEditor-WDHPTWX7.js} +3 -3
  4. package/dist/{StreamedArtifactEditor-HTNPG4NB.js.map → StreamedArtifactEditor-WDHPTWX7.js.map} +1 -1
  5. package/dist/agents/index.cjs +390 -326
  6. package/dist/agents/index.js +9 -9
  7. package/dist/agents/tasks/ConversationListView.d.ts +2 -1
  8. package/dist/agents/tasks/ConversationTurnSpeaker.d.ts +3 -1
  9. package/dist/agents/tasks/TaskFlow.d.ts +17 -0
  10. package/dist/agents/tasks/ThreadLauncher.d.ts +51 -0
  11. package/dist/agents/tasks/ThreadStatusLine.d.ts +33 -0
  12. package/dist/agents/tasks/WorkflowRunStatus.d.ts +32 -0
  13. package/dist/agents/tasks/WorkflowThreadStrip.d.ts +29 -3
  14. package/dist/agents/tasks/compact-thread-activity.d.ts +5 -2
  15. package/dist/agents/tasks/index.d.ts +3 -0
  16. package/dist/agents/workflows/StepBarFrame.d.ts +18 -17
  17. package/dist/agents/workflows/StepChip.d.ts +37 -0
  18. package/dist/agents/workflows/StepDocuments.d.ts +64 -0
  19. package/dist/agents/workflows/WorkflowStepBar.d.ts +1 -2
  20. package/dist/agents/workflows/index.d.ts +2 -0
  21. package/dist/agents/workflows/stepKinds.d.ts +24 -0
  22. package/dist/artifacts/VersionTimeline.d.ts +7 -0
  23. package/dist/artifacts/index.cjs +21 -21
  24. package/dist/artifacts/index.js +1 -1
  25. package/dist/chat/ChatPage.d.ts +1 -1
  26. package/dist/chat/DraftingDocChip.d.ts +22 -0
  27. package/dist/chat/WorkflowStepChip.d.ts +23 -5
  28. package/dist/chat/chat-page-types.d.ts +18 -2
  29. package/dist/chat/flashMessage.d.ts +6 -0
  30. package/dist/chat/index.cjs +144 -131
  31. package/dist/chat/index.d.ts +2 -0
  32. package/dist/chat/index.js +4 -3
  33. package/dist/{chunk-SHASZLGD.js → chunk-3AV7HP6G.js} +3 -3
  34. package/dist/{chunk-SHASZLGD.js.map → chunk-3AV7HP6G.js.map} +1 -1
  35. package/dist/{chunk-UDK553WP.cjs → chunk-4VCKYR4D.cjs} +4 -4
  36. package/dist/{chunk-UDK553WP.cjs.map → chunk-4VCKYR4D.cjs.map} +1 -1
  37. package/dist/chunk-7HAM7Y5U.js +907 -0
  38. package/dist/chunk-7HAM7Y5U.js.map +1 -0
  39. package/dist/{chunk-TCNYKDYE.js → chunk-CXLVI3SB.js} +73 -40
  40. package/dist/chunk-CXLVI3SB.js.map +1 -0
  41. package/dist/{chunk-N7ARMX3O.cjs → chunk-D7WCGOD4.cjs} +3 -3
  42. package/dist/{chunk-N7ARMX3O.cjs.map → chunk-D7WCGOD4.cjs.map} +1 -1
  43. package/dist/{chunk-ZP4IFW2E.js → chunk-EJSJ27HV.js} +733 -185
  44. package/dist/chunk-EJSJ27HV.js.map +1 -0
  45. package/dist/{chunk-AY32GGKU.js → chunk-ERNMU6RV.js} +132 -752
  46. package/dist/chunk-ERNMU6RV.js.map +1 -0
  47. package/dist/{chunk-XFZ7HNPG.js → chunk-ETN5EZI4.js} +3 -3
  48. package/dist/{chunk-XFZ7HNPG.js.map → chunk-ETN5EZI4.js.map} +1 -1
  49. package/dist/{chunk-Z2NSU7D5.cjs → chunk-FL5TEBTM.cjs} +770 -216
  50. package/dist/chunk-FL5TEBTM.cjs.map +1 -0
  51. package/dist/chunk-HM23LXUP.cjs +976 -0
  52. package/dist/chunk-HM23LXUP.cjs.map +1 -0
  53. package/dist/{chunk-WN64RF46.js → chunk-HQH35JWC.js} +3 -3
  54. package/dist/{chunk-WN64RF46.js.map → chunk-HQH35JWC.js.map} +1 -1
  55. package/dist/{chunk-XSUOEJB3.cjs → chunk-MRURIBBB.cjs} +163 -837
  56. package/dist/chunk-MRURIBBB.cjs.map +1 -0
  57. package/dist/{chunk-65HZ36MY.js → chunk-OTDGTBAS.js} +20 -3
  58. package/dist/chunk-OTDGTBAS.js.map +1 -0
  59. package/dist/{chunk-CK4C3IQR.cjs → chunk-VMZXFYHK.cjs} +47 -6
  60. package/dist/chunk-VMZXFYHK.cjs.map +1 -0
  61. package/dist/{chunk-SVJQWLOF.cjs → chunk-W4GXDARU.cjs} +20 -3
  62. package/dist/chunk-W4GXDARU.cjs.map +1 -0
  63. package/dist/{chunk-US5ASM4G.cjs → chunk-WEUCLOBB.cjs} +5 -5
  64. package/dist/{chunk-US5ASM4G.cjs.map → chunk-WEUCLOBB.cjs.map} +1 -1
  65. package/dist/{chunk-S2KVJYBD.cjs → chunk-WV4IDVDQ.cjs} +76 -43
  66. package/dist/chunk-WV4IDVDQ.cjs.map +1 -0
  67. package/dist/{chunk-2FUJXMGO.js → chunk-Y4X3RBFI.js} +44 -6
  68. package/dist/{chunk-CK4C3IQR.cjs.map → chunk-Y4X3RBFI.js.map} +1 -1
  69. package/dist/collaboration/index.cjs +1 -1
  70. package/dist/collaboration/index.js +1 -1
  71. package/dist/connect/docx.cjs +4 -4
  72. package/dist/connect/docx.js +3 -3
  73. package/dist/connect/index.cjs +68 -51
  74. package/dist/connect/index.cjs.map +1 -1
  75. package/dist/connect/index.js +37 -20
  76. package/dist/connect/index.js.map +1 -1
  77. package/dist/connection/WorkflowRunThread.d.ts +4 -4
  78. package/dist/connection/ai.d.ts +2 -0
  79. package/dist/facts/index.cjs +1 -1
  80. package/dist/facts/index.js +1 -1
  81. package/dist/files/index.cjs +3 -3
  82. package/dist/files/index.js +3 -3
  83. package/dist/index.cjs +728 -652
  84. package/dist/index.js +16 -16
  85. package/dist/settings/index.cjs +1 -1
  86. package/dist/settings/index.js +1 -1
  87. package/dist/shell/index.cjs +10 -10
  88. package/dist/shell/index.js +2 -2
  89. package/dist/site/index.cjs +5 -5
  90. package/dist/site/index.js +1 -1
  91. package/dist/studio/index.cjs +6 -5
  92. package/dist/studio/index.cjs.map +1 -1
  93. package/dist/studio/index.js +5 -4
  94. package/dist/studio/index.js.map +1 -1
  95. package/dist/workflow-canvas/WorkflowCanvas.d.ts +0 -9
  96. package/dist/workflow-canvas/edit.d.ts +2 -11
  97. package/dist/workflow-canvas/index.cjs +63 -87
  98. package/dist/workflow-canvas/index.cjs.map +1 -1
  99. package/dist/workflow-canvas/index.js +14 -38
  100. package/dist/workflow-canvas/index.js.map +1 -1
  101. package/node_modules/@arbidocs/coedit/dist/commands.cjs +25 -13
  102. package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
  103. package/node_modules/@arbidocs/coedit/dist/commands.d.cts +3 -1
  104. package/node_modules/@arbidocs/coedit/dist/commands.d.ts +3 -1
  105. package/node_modules/@arbidocs/coedit/dist/commands.js +25 -14
  106. package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
  107. package/node_modules/@arbidocs/coedit/package.json +1 -1
  108. package/package.json +4 -4
  109. package/src/blocks.css +168 -0
  110. package/src/workflow-canvas/canvas.css +2 -40
  111. package/dist/chunk-2FUJXMGO.js.map +0 -1
  112. package/dist/chunk-65HZ36MY.js.map +0 -1
  113. package/dist/chunk-AY32GGKU.js.map +0 -1
  114. package/dist/chunk-B4SRYJLM.cjs +0 -107
  115. package/dist/chunk-B4SRYJLM.cjs.map +0 -1
  116. package/dist/chunk-HOXKR26S.js +0 -103
  117. package/dist/chunk-HOXKR26S.js.map +0 -1
  118. package/dist/chunk-S2KVJYBD.cjs.map +0 -1
  119. package/dist/chunk-SVJQWLOF.cjs.map +0 -1
  120. package/dist/chunk-TCNYKDYE.js.map +0 -1
  121. package/dist/chunk-XSUOEJB3.cjs.map +0 -1
  122. package/dist/chunk-Z2NSU7D5.cjs.map +0 -1
  123. package/dist/chunk-ZP4IFW2E.js.map +0 -1
@@ -1171,19 +1171,28 @@ function definitionOfAnchor(anchor, definitions) {
1171
1171
  // src/commands/everywhere.ts
1172
1172
  var WORD = "[\\p{L}\\p{N}_\\-\u2010\u2011]";
1173
1173
  var escape = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1174
+ var ARTICLE = /^(the|a|an|this|that|such|said)\s+/i;
1175
+ var withoutArticle = (words) => words.replace(/\s+/g, " ").trim().replace(ARTICLE, "");
1176
+ var anyCase = (word) => `[${word[0].toUpperCase()}${word[0].toLowerCase()}]${escape(word.slice(1))}`;
1174
1177
  function needlesOf(spec) {
1175
- const term = spec.term.replace(/\s+/g, " ").trim();
1176
- const variants = [
1177
- ...new Set((spec.variants ?? []).map((v) => v.replace(/\s+/g, " ").trim()))
1178
- ].filter((v) => v && v !== term);
1179
- const needles = [
1180
- ...variants.map((text) => ({ text, kind: "variant" })),
1181
- ...spec.link ? [{ text: term, kind: "term" }] : []
1182
- ];
1178
+ const term = withoutArticle(spec.term);
1179
+ const seen = /* @__PURE__ */ new Set();
1180
+ const needles = [];
1181
+ for (const raw of spec.variants ?? []) {
1182
+ const words = raw.replace(/\s+/g, " ").trim();
1183
+ const article = ARTICLE.exec(words)?.[1] ?? "";
1184
+ const text = words.slice(article ? ARTICLE.exec(words)[0].length : 0);
1185
+ const key = `${article.toLowerCase()} ${text}`;
1186
+ if (!text || text === term || seen.has(key)) continue;
1187
+ seen.add(key);
1188
+ needles.push({ text, article, kind: "variant" });
1189
+ }
1190
+ if (spec.link) needles.push({ text: term, article: "", kind: "term" });
1183
1191
  return needles.map((n) => ({
1184
- ...n,
1192
+ text: n.text,
1193
+ kind: n.kind,
1185
1194
  pattern: new RegExp(
1186
- `(?<!${WORD})${n.text.split(" ").map(escape).join("\\s+")}(?!${WORD})`,
1195
+ `(?<!${WORD})(${n.article ? `${anyCase(n.article)}\\s+` : ""})(${n.text.split(" ").map(escape).join("\\s+")})(?!${WORD})`,
1187
1196
  "gu"
1188
1197
  )
1189
1198
  }));
@@ -1192,7 +1201,7 @@ function matchesIn(text, needles) {
1192
1201
  const found = [];
1193
1202
  for (const needle of needles)
1194
1203
  for (const m of text.matchAll(needle.pattern))
1195
- found.push({ offset: m.index ?? 0, text: m[0], kind: needle.kind });
1204
+ found.push({ offset: (m.index ?? 0) + m[1].length, text: m[2], kind: needle.kind });
1196
1205
  found.sort((a, b) => a.offset - b.offset || b.text.length - a.text.length);
1197
1206
  const out = [];
1198
1207
  for (const m of found)
@@ -1203,7 +1212,9 @@ function matchesIn(text, needles) {
1203
1212
  var overlaps = (start, end, from, to) => start < to && from < end;
1204
1213
  function findTermUses(paragraphs, spec, bookmark) {
1205
1214
  const needles = needlesOf(spec);
1206
- const defining = new Set([spec.term, ...spec.variants ?? []].map(termKey));
1215
+ const defining = new Set(
1216
+ [spec.term, ...spec.variants ?? []].map((w) => termKey(withoutArticle(w)))
1217
+ );
1207
1218
  const uses = [];
1208
1219
  const skipped = [];
1209
1220
  for (const p of paragraphs) {
@@ -1242,7 +1253,7 @@ var TermEverywhereError = class extends Error {
1242
1253
  }
1243
1254
  };
1244
1255
  function applyTermEverywhere(port, spec, { accept } = {}) {
1245
- const term = spec.term.replace(/\s+/g, " ").trim();
1256
+ const term = withoutArticle(spec.term);
1246
1257
  if (!term) throw new Error("Name the defined term.");
1247
1258
  let addedDefinition = false;
1248
1259
  let link;
@@ -1419,5 +1430,6 @@ exports.tableState = tableState;
1419
1430
  exports.termKey = termKey;
1420
1431
  exports.termLinkXml = termLinkXml;
1421
1432
  exports.undoOps = undoOps;
1433
+ exports.withoutArticle = withoutArticle;
1422
1434
  //# sourceMappingURL=commands.cjs.map
1423
1435
  //# sourceMappingURL=commands.cjs.map