@arbidocs/blocks 0.4.81 → 0.4.83

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 (55) hide show
  1. package/dist/agents/index.cjs +278 -278
  2. package/dist/agents/index.js +3 -3
  3. package/dist/agents/workflows/StepBarFrame.d.ts +12 -4
  4. package/dist/{chunk-THCFZKTM.js → chunk-CONIA2ZA.js} +8 -8
  5. package/dist/chunk-CONIA2ZA.js.map +1 -0
  6. package/dist/{chunk-SWSVPQNB.js → chunk-RSKSXEPW.js} +199 -18
  7. package/dist/chunk-RSKSXEPW.js.map +1 -0
  8. package/dist/{chunk-I56ORHPY.js → chunk-RX35SMPR.js} +5 -5
  9. package/dist/{chunk-I56ORHPY.js.map → chunk-RX35SMPR.js.map} +1 -1
  10. package/dist/{chunk-BX7JWZWE.cjs → chunk-RYYYHPFU.cjs} +8 -8
  11. package/dist/chunk-RYYYHPFU.cjs.map +1 -0
  12. package/dist/{chunk-F5WIETZY.cjs → chunk-XA5S4776.cjs} +44 -44
  13. package/dist/chunk-XA5S4776.cjs.map +1 -0
  14. package/dist/{chunk-UA2AMDR6.cjs → chunk-ZQYE7J3J.cjs} +201 -13
  15. package/dist/chunk-ZQYE7J3J.cjs.map +1 -0
  16. package/dist/connect/index.cjs +49 -28
  17. package/dist/connect/index.cjs.map +1 -1
  18. package/dist/connect/index.js +34 -13
  19. package/dist/connect/index.js.map +1 -1
  20. package/dist/connection/ConnectedTagMatrix.d.ts +6 -3
  21. package/dist/connection/ConnectedWorkflowBuilder.d.ts +9 -2
  22. package/dist/facts/index.cjs +1 -1
  23. package/dist/facts/index.js +1 -1
  24. package/dist/files/index.cjs +20 -1
  25. package/dist/files/index.cjs.map +1 -1
  26. package/dist/files/index.js +20 -2
  27. package/dist/files/index.js.map +1 -1
  28. package/dist/files/views/TagFormParts.d.ts +8 -0
  29. package/dist/files/views/index.d.ts +1 -1
  30. package/dist/home/index.cjs +1 -1
  31. package/dist/home/index.js +1 -1
  32. package/dist/index.cjs +696 -398
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.js +279 -8
  35. package/dist/index.js.map +1 -1
  36. package/dist/shell/index.cjs +1 -1
  37. package/dist/shell/index.js +1 -1
  38. package/dist/studio/index.cjs +1 -1
  39. package/dist/studio/index.js +1 -1
  40. package/dist/tags/TagDetail.d.ts +38 -0
  41. package/dist/tags/TagMatrix.d.ts +31 -8
  42. package/dist/tags/TagsNav.d.ts +44 -0
  43. package/dist/tags/index.d.ts +9 -3
  44. package/dist/tags/tagMatrixDocx.d.ts +45 -0
  45. package/dist/tags/tagMatrixModel.d.ts +10 -6
  46. package/dist/workflow-canvas/index.cjs +81 -63
  47. package/dist/workflow-canvas/index.cjs.map +1 -1
  48. package/dist/workflow-canvas/index.js +39 -21
  49. package/dist/workflow-canvas/index.js.map +1 -1
  50. package/package.json +4 -4
  51. package/dist/chunk-BX7JWZWE.cjs.map +0 -1
  52. package/dist/chunk-F5WIETZY.cjs.map +0 -1
  53. package/dist/chunk-SWSVPQNB.js.map +0 -1
  54. package/dist/chunk-THCFZKTM.js.map +0 -1
  55. package/dist/chunk-UA2AMDR6.cjs.map +0 -1
@@ -7,11 +7,11 @@ import { ConnectionProvider, useConnection } from '../chunk-OYMWV45N.js';
7
7
  export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-OYMWV45N.js';
8
8
  import { SignDocumentDialog } from '../chunk-FE4ULGOR.js';
9
9
  import '../chunk-OPA2Y6YZ.js';
10
- import { TagMatrix, tagMatrixMarkdown } from '../chunk-SWSVPQNB.js';
11
- import { StreamedArtifactFrame } from '../chunk-LOJVUGBJ.js';
12
- import { splitDocRef, WorkflowStepBar, stepLevels, WorkflowRunner, initialRunInputs, workflowSteps, fromPlanSteps, stepStatesFromActivity, toPlanSteps, runThreadTitle, useWorkflowView, stepFields } from '../chunk-THCFZKTM.js';
10
+ import { TagMatrix, tagMatrixDocx, DOCX_MIME_TYPE } from '../chunk-RSKSXEPW.js';
11
+ import { splitDocRef, WorkflowStepBar, stepLevels, WorkflowRunner, initialRunInputs, workflowSteps, fromPlanSteps, stepStatesFromActivity, toPlanSteps, runThreadTitle, useWorkflowView, stepFields } from '../chunk-CONIA2ZA.js';
13
12
  import '../chunk-EVUEIBNU.js';
14
13
  import '../chunk-XD2M6LIG.js';
14
+ import { StreamedArtifactFrame } from '../chunk-LOJVUGBJ.js';
15
15
  import '../chunk-VILAPTCB.js';
16
16
  import { ChatPage } from '../chunk-EWSEQEPL.js';
17
17
  import '../chunk-KZJAG7T3.js';
@@ -963,6 +963,7 @@ function ConnectedTagMatrix({
963
963
  linksLimit = 3,
964
964
  exportTitle,
965
965
  onExported,
966
+ downloadable = true,
966
967
  readOnly,
967
968
  ...props
968
969
  }) {
@@ -981,6 +982,16 @@ function ConnectedTagMatrix({
981
982
  label: [m.user.given_name, m.user.family_name].filter(Boolean).join(" ") || m.user.email
982
983
  }));
983
984
  const fail = (e) => setError(e instanceof Error ? e.message : String(e));
985
+ const snapshot = (data) => {
986
+ const title = exportTitle ?? data.parent?.name ?? "Matrix";
987
+ const bytes = tagMatrixDocx(data, {
988
+ title,
989
+ nameOf: (id) => people.find((p) => p.value === id)?.label
990
+ });
991
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
992
+ const name = `${title.replace(/[\\/:*?"<>|]+/g, "-")} (${stamp}).docx`;
993
+ return { blob: new Blob([bytes], { type: DOCX_MIME_TYPE }), name };
994
+ };
984
995
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
985
996
  /* @__PURE__ */ jsx(
986
997
  TagMatrix,
@@ -1008,22 +1019,32 @@ function ConnectedTagMatrix({
1008
1019
  try {
1009
1020
  const data = matrix.data;
1010
1021
  if (!data) return;
1011
- const title = exportTitle ?? data.parent?.name ?? "Matrix";
1012
- const markdown = tagMatrixMarkdown(data, {
1013
- title,
1014
- nameOf: (id2) => people.find((p) => p.value === id2)?.label
1015
- });
1022
+ const { blob, name } = snapshot(data);
1016
1023
  await ensureWorkspaceOpen();
1017
- const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
1018
- const uploaded = await arbi.documents.uploadFile(
1019
- new Blob([markdown], { type: "text/markdown" }),
1020
- `${title} (${stamp}).md`
1021
- );
1024
+ const uploaded = await arbi.documents.uploadFile(blob, name);
1022
1025
  const id = uploaded?.doc_ext_ids?.[0];
1023
1026
  if (id) onExported(id);
1024
1027
  } catch (e) {
1025
1028
  fail(e);
1026
1029
  }
1030
+ } : void 0,
1031
+ onDownload: downloadable && matrix.data ? () => {
1032
+ setError(null);
1033
+ try {
1034
+ const data = matrix.data;
1035
+ if (!data) return;
1036
+ const { blob, name } = snapshot(data);
1037
+ const url = URL.createObjectURL(blob);
1038
+ const link = document.createElement("a");
1039
+ link.href = url;
1040
+ link.download = name;
1041
+ document.body.appendChild(link);
1042
+ link.click();
1043
+ link.remove();
1044
+ setTimeout(() => URL.revokeObjectURL(url), 0);
1045
+ } catch (e) {
1046
+ fail(e);
1047
+ }
1027
1048
  } : void 0
1028
1049
  }
1029
1050
  ),