@arbidocs/blocks 0.4.106 → 0.4.107

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 (112) hide show
  1. package/bin/arbidocs-render-take.mjs +27 -0
  2. package/dist/NativeDocxEditor-3VKJT43D.js +10 -0
  3. package/dist/NativeDocxEditor-3VKJT43D.js.map +1 -0
  4. package/dist/NativeDocxEditor-GNG5QV7V.cjs +31 -0
  5. package/dist/NativeDocxEditor-GNG5QV7V.cjs.map +1 -0
  6. package/dist/agents/index.cjs +209 -209
  7. package/dist/agents/index.js +4 -4
  8. package/dist/chat/index.cjs +125 -125
  9. package/dist/chat/index.js +3 -3
  10. package/dist/{chunk-PIT2YZCK.js → chunk-2PYENCW5.js} +3 -3
  11. package/dist/{chunk-PIT2YZCK.js.map → chunk-2PYENCW5.js.map} +1 -1
  12. package/dist/{chunk-W2RTZOK3.js → chunk-2SJTXYRM.js} +1749 -1778
  13. package/dist/chunk-2SJTXYRM.js.map +1 -0
  14. package/dist/{chunk-S7RHJI5Q.js → chunk-7NLPKJV5.js} +3 -3
  15. package/dist/{chunk-S7RHJI5Q.js.map → chunk-7NLPKJV5.js.map} +1 -1
  16. package/dist/{chunk-ZWWN4CUL.cjs → chunk-BHKFENKT.cjs} +1748 -1778
  17. package/dist/chunk-BHKFENKT.cjs.map +1 -0
  18. package/dist/{chunk-3R6XBYL7.cjs → chunk-DTBSGG36.cjs} +7 -2
  19. package/dist/chunk-DTBSGG36.cjs.map +1 -0
  20. package/dist/{chunk-3Y6NQIDE.js → chunk-EB7QAZLH.js} +5 -5
  21. package/dist/{chunk-3Y6NQIDE.js.map → chunk-EB7QAZLH.js.map} +1 -1
  22. package/dist/{chunk-TP3FAP5J.cjs → chunk-FZGMY6NQ.cjs} +5 -5
  23. package/dist/{chunk-TP3FAP5J.cjs.map → chunk-FZGMY6NQ.cjs.map} +1 -1
  24. package/dist/{chunk-W7NZRZ54.js → chunk-GFYGYME3.js} +3 -3
  25. package/dist/{chunk-W7NZRZ54.js.map → chunk-GFYGYME3.js.map} +1 -1
  26. package/dist/chunk-GYAUJ4KT.js +71 -0
  27. package/dist/chunk-GYAUJ4KT.js.map +1 -0
  28. package/dist/{chunk-XMBYDLZQ.cjs → chunk-HUJLKDWX.cjs} +4 -4
  29. package/dist/{chunk-XMBYDLZQ.cjs.map → chunk-HUJLKDWX.cjs.map} +1 -1
  30. package/dist/{chunk-4GFB5U3K.js → chunk-LHBJJ2GE.js} +4 -3
  31. package/dist/chunk-LHBJJ2GE.js.map +1 -0
  32. package/dist/{chunk-MP6FK43E.cjs → chunk-O5NDG4EA.cjs} +3 -3
  33. package/dist/{chunk-MP6FK43E.cjs.map → chunk-O5NDG4EA.cjs.map} +1 -1
  34. package/dist/{chunk-5YXG342J.cjs → chunk-OR4CO743.cjs} +3 -3
  35. package/dist/{chunk-5YXG342J.cjs.map → chunk-OR4CO743.cjs.map} +1 -1
  36. package/dist/{chunk-LGX6UFYG.js → chunk-P2KPDPFF.js} +8 -3
  37. package/dist/chunk-P2KPDPFF.js.map +1 -0
  38. package/dist/{chunk-DDF5GPIJ.js → chunk-P5ST47VY.js} +3 -3
  39. package/dist/{chunk-DDF5GPIJ.js.map → chunk-P5ST47VY.js.map} +1 -1
  40. package/dist/{chunk-EWSEQEPL.js → chunk-PFA43QNX.js} +3 -3
  41. package/dist/{chunk-EWSEQEPL.js.map → chunk-PFA43QNX.js.map} +1 -1
  42. package/dist/{chunk-7LLLQUM7.cjs → chunk-Q57MEBCK.cjs} +6 -5
  43. package/dist/chunk-Q57MEBCK.cjs.map +1 -0
  44. package/dist/{chunk-LLFW2T6S.cjs → chunk-R6APX23R.cjs} +11 -11
  45. package/dist/{chunk-LLFW2T6S.cjs.map → chunk-R6APX23R.cjs.map} +1 -1
  46. package/dist/{chunk-24ND4S6Y.cjs → chunk-RILMICOP.cjs} +5 -5
  47. package/dist/{chunk-24ND4S6Y.cjs.map → chunk-RILMICOP.cjs.map} +1 -1
  48. package/dist/chunk-S24XEVPS.cjs +73 -0
  49. package/dist/chunk-S24XEVPS.cjs.map +1 -0
  50. package/dist/{chunk-XQDM6T6C.js → chunk-WDD255XQ.js} +3 -3
  51. package/dist/{chunk-XQDM6T6C.js.map → chunk-WDD255XQ.js.map} +1 -1
  52. package/dist/{chunk-Z5VUZ6YD.cjs → chunk-ZV3BKLFY.cjs} +3 -3
  53. package/dist/{chunk-Z5VUZ6YD.cjs.map → chunk-ZV3BKLFY.cjs.map} +1 -1
  54. package/dist/collaboration/index.cjs +15 -15
  55. package/dist/collaboration/index.js +1 -1
  56. package/dist/collaboration/mail/MailMessageView.d.ts +3 -1
  57. package/dist/connect/docx.cjs +7 -6
  58. package/dist/connect/docx.cjs.map +1 -1
  59. package/dist/connect/docx.js +5 -4
  60. package/dist/connect/docx.js.map +1 -1
  61. package/dist/connect/index.cjs +407 -91
  62. package/dist/connect/index.cjs.map +1 -1
  63. package/dist/connect/index.js +361 -46
  64. package/dist/connect/index.js.map +1 -1
  65. package/dist/connection/mail/ConnectedMailComposer.d.ts +12 -2
  66. package/dist/connection/mail/ConnectedMailMessage.d.ts +19 -0
  67. package/dist/connection/mail/ConnectedMailbox.d.ts +7 -3
  68. package/dist/connection/mail/MailComposerForm.d.ts +12 -2
  69. package/dist/connection/mail/index.d.ts +2 -1
  70. package/dist/connection/mail/types.d.ts +15 -0
  71. package/dist/connection/mail/useWordBody.d.ts +48 -0
  72. package/dist/docx/NativeDocxEditor.d.ts +9 -1
  73. package/dist/docx/index.cjs +51 -50
  74. package/dist/docx/index.cjs.map +1 -1
  75. package/dist/docx/index.js +4 -3
  76. package/dist/docx/index.js.map +1 -1
  77. package/dist/facts/index.cjs +2 -2
  78. package/dist/facts/index.js +2 -2
  79. package/dist/files/index.cjs +2 -2
  80. package/dist/files/index.js +2 -2
  81. package/dist/home/index.cjs +17 -17
  82. package/dist/home/index.js +3 -3
  83. package/dist/index.cjs +442 -442
  84. package/dist/index.js +8 -8
  85. package/dist/record/index.cjs +307 -66
  86. package/dist/record/index.cjs.map +1 -1
  87. package/dist/record/index.d.ts +145 -26
  88. package/dist/record/index.js +301 -67
  89. package/dist/record/index.js.map +1 -1
  90. package/dist/retrieval/index.cjs +1 -1
  91. package/dist/retrieval/index.js +1 -1
  92. package/dist/settings/index.cjs +35 -35
  93. package/dist/settings/index.js +2 -2
  94. package/dist/shell/index.cjs +1 -1
  95. package/dist/shell/index.js +1 -1
  96. package/dist/studio/index.cjs +4 -4
  97. package/dist/studio/index.js +3 -3
  98. package/dist/workflow-canvas/index.cjs +11 -11
  99. package/dist/workflow-canvas/index.js +4 -4
  100. package/dist/workspaces/index.cjs +2 -2
  101. package/dist/workspaces/index.js +2 -2
  102. package/node_modules/@arbidocs/coedit/package.json +1 -1
  103. package/package.json +8 -5
  104. package/record/render-overlays.mjs +152 -0
  105. package/record/render-take.py +985 -0
  106. package/src/docx/styles.css +22 -0
  107. package/dist/chunk-3R6XBYL7.cjs.map +0 -1
  108. package/dist/chunk-4GFB5U3K.js.map +0 -1
  109. package/dist/chunk-7LLLQUM7.cjs.map +0 -1
  110. package/dist/chunk-LGX6UFYG.js.map +0 -1
  111. package/dist/chunk-W2RTZOK3.js.map +0 -1
  112. package/dist/chunk-ZWWN4CUL.cjs.map +0 -1
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Render the overlays of a demo video (title and chapter cards, lower-thirds, captions, callouts) as
3
+ * transparent PNGs in the take's brand (`@arbidocs/blocks/record`: `createCinematic({ brand })`).
4
+ * `render-take.py` writes the list and composes the PNGs over the take with ffmpeg; nothing here
5
+ * knows about video.
6
+ *
7
+ * node render-overlays.mjs <overlays.json> <out-dir>
8
+ *
9
+ * `overlays.json`: {"width": 1920, "height": 1080, "brand": {...}, "items": [{"id", "kind", ...}]}.
10
+ * Each item becomes `<out-dir>/<id>.png`; `<out-dir>/sizes.json` maps each id to its PNG's {w, h}.
11
+ * Cards fill the frame; the rest are cropped to their own box (with room for their shadow) and
12
+ * placed by the renderer.
13
+ */
14
+ import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'
15
+ import path from 'node:path'
16
+ import process from 'node:process'
17
+ import { pathToFileURL } from 'node:url'
18
+ import { chromium } from '@playwright/test'
19
+
20
+ /** Shadow room around a cropped overlay, so its shadow is in the PNG (render-take.py: SHADOW_PAD). */
21
+ export const SHADOW_PAD = 64
22
+ /** Gap between a callout's ring and its tag, and the tag's height (render-take.py: CALLOUT_TAG). */
23
+ export const CALLOUT_TAG = { height: 36, gap: 10 }
24
+
25
+ const esc = (s = '') =>
26
+ s.replace(/[&<>"]/g, (ch) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[ch])
27
+
28
+ /** The brand the take recorded (the stage's skin), with the harness's neutral defaults. */
29
+ function skin(brand = {}) {
30
+ return {
31
+ firmLabel: brand.firmLabel ?? '',
32
+ displayFont: brand.displayFont ?? 'ui-serif, Georgia, serif',
33
+ sansFont: brand.sansFont ?? 'Inter, ui-sans-serif, system-ui, sans-serif',
34
+ from: brand.coverFrom ?? '#0b1622',
35
+ mid: brand.coverMid ?? '#0e1b2c',
36
+ to: brand.coverTo ?? '#1f6feb',
37
+ accent: brand.accent ?? '#c9a24b',
38
+ ink: brand.ink ?? '#0e1b2d',
39
+ text: brand.coverTitle ?? '#f4f6f8',
40
+ fontFiles: brand.fontFiles ?? [],
41
+ }
42
+ }
43
+
44
+ const css = (s) => `
45
+ ${s.fontFiles.map((f) => `@font-face { font-family: "${f.family}"; font-weight: ${f.weight ?? '100 900'}; src: url(${f.url});${f.unicodeRange ? ` unicode-range: ${f.unicodeRange};` : ''} }`).join('\n')}
46
+ :root { --ink: ${s.ink}; --from: ${s.from}; --mid: ${s.mid}; --to: ${s.to}; --text: ${s.text}; --accent: ${s.accent};
47
+ --display: ${s.displayFont}; --sans: ${s.sansFont}; }
48
+ * { box-sizing: border-box; margin: 0; }
49
+ html, body { background: transparent; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
50
+ #o { position: absolute; left: 0; top: 0; }
51
+
52
+ .card { width: var(--w); height: var(--h); position: relative; overflow: hidden; color: var(--text);
53
+ background: radial-gradient(120% 90% at 100% 110%, color-mix(in srgb, var(--to) 55%, transparent) 0%, transparent 55%),
54
+ linear-gradient(135deg, var(--from) 0%, var(--mid) 60%, var(--from) 100%); }
55
+ .card::before { content: ""; position: absolute; inset: 40px; border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); border-radius: 4px; }
56
+ .card .in { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 11%; }
57
+ .card.centre .in { align-items: center; text-align: center; }
58
+ .kicker { text-transform: uppercase; letter-spacing: .28em; font-size: 22px; font-weight: 600; color: var(--accent); }
59
+ .card h1 { font-family: var(--display); font-weight: 560; font-size: 92px; line-height: 1.04; letter-spacing: -.02em; margin-top: 30px; max-width: 15ch; }
60
+ .card.centre h1 { font-size: 80px; max-width: 18ch; }
61
+ .card p { margin-top: 30px; font-size: 31px; line-height: 1.48; color: color-mix(in srgb, var(--text) 74%, transparent); max-width: 46ch; }
62
+ .card .mark { position: absolute; left: 11%; bottom: 96px; display: flex; align-items: center; gap: 16px; font-size: 22px; color: color-mix(in srgb, var(--text) 64%, transparent); }
63
+ .card.centre .mark { left: 0; right: 0; justify-content: center; }
64
+ .card .rule { width: 56px; height: 2px; background: var(--accent); }
65
+
66
+ .pad { padding: ${SHADOW_PAD}px; display: inline-block; }
67
+ .lt { display: flex; gap: 0; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--ink) 93%, transparent);
68
+ box-shadow: 0 14px 40px rgba(0,0,0,.38); }
69
+ .lt .bar { width: 6px; background: var(--accent); }
70
+ .lt .tx { padding: 18px 34px 20px 24px; }
71
+ .lt .kicker { font-size: 15px; }
72
+ .lt .t { font-family: var(--display); font-weight: 560; font-size: 36px; line-height: 1.15; color: var(--text); margin-top: 6px; white-space: nowrap; }
73
+
74
+ .cap { max-width: 1380px; padding: 18px 36px; border-radius: 16px; text-align: center; color: #fff;
75
+ font: 500 29px/1.42 var(--sans); letter-spacing: .005em; background: color-mix(in srgb, var(--ink) 91%, transparent);
76
+ box-shadow: 0 12px 38px rgba(0,0,0,.42); }
77
+
78
+ .co { position: relative; }
79
+ .co .ring { position: absolute; left: 0; right: 0; border: 3px solid var(--accent); border-radius: 12px;
80
+ box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 24%, transparent), 0 10px 34px rgba(0,0,0,.28); }
81
+ .co .tag { position: absolute; left: 0; height: ${CALLOUT_TAG.height}px; display: flex; align-items: center; padding: 0 14px; border-radius: 8px;
82
+ background: var(--accent); color: var(--ink); font: 650 18px/1 var(--sans); letter-spacing: .01em; white-space: nowrap;
83
+ box-shadow: 0 6px 18px rgba(0,0,0,.3); }
84
+ `
85
+
86
+ function markup(item, w, h, s) {
87
+ switch (item.kind) {
88
+ case 'title':
89
+ case 'chapter':
90
+ case 'end': {
91
+ const centre = item.kind === 'title' ? '' : ' centre'
92
+ const mark = s.firmLabel
93
+ ? `<div class="mark"><span class="rule"></span><span>${esc(s.firmLabel)}</span></div>`
94
+ : ''
95
+ return `<div class="card${centre}" style="--w:${w}px;--h:${h}px"><div class="in">
96
+ <div class="kicker">${esc(item.kicker)}</div><h1>${esc(item.title)}</h1>${item.subtitle ? `<p>${esc(item.subtitle)}</p>` : ''}</div>${mark}</div>`
97
+ }
98
+ case 'lower-third':
99
+ return `<div class="pad"><div class="lt"><div class="bar"></div><div class="tx"><div class="kicker">${esc(item.kicker)}</div><div class="t">${esc(item.title)}</div></div></div></div>`
100
+ case 'caption':
101
+ return `<div class="pad"><div class="cap">${esc(item.text)}</div></div>`
102
+ case 'callout': {
103
+ const { height, gap } = CALLOUT_TAG
104
+ const tag = item.label ? height + gap : 0
105
+ const ringTop = item.tagBelow ? 0 : tag
106
+ const tagTop = item.tagBelow ? item.h + gap : 0
107
+ return `<div class="pad"><div class="co" style="width:${item.w}px;height:${item.h + tag}px">
108
+ <div class="ring" style="top:${ringTop}px;height:${item.h}px"></div>
109
+ ${item.label ? `<div class="tag" style="top:${tagTop}px">${esc(item.label)}</div>` : ''}</div></div>`
110
+ }
111
+ default:
112
+ throw new Error(`unknown overlay kind: ${item.kind}`)
113
+ }
114
+ }
115
+
116
+ async function main() {
117
+ const [specFile, outDir] = process.argv.slice(2)
118
+ if (!specFile || !outDir) throw new Error('usage: render-overlays.mjs <overlays.json> <out-dir>')
119
+ const spec = JSON.parse(readFileSync(specFile, 'utf8'))
120
+ const s = skin(spec.brand)
121
+ mkdirSync(outDir, { recursive: true })
122
+ const html = path.join(outDir, 'overlay.html')
123
+ writeFileSync(
124
+ html,
125
+ `<!doctype html><html><head><meta charset="utf-8"><style>${css(s)}</style></head><body><div id="o"></div></body></html>`
126
+ )
127
+ const browser = await chromium.launch()
128
+ const sizes = {}
129
+ try {
130
+ const page = await browser.newPage({ viewport: { width: spec.width, height: spec.height } })
131
+ await page.goto(pathToFileURL(html).href)
132
+ await page.evaluate(() => document.fonts.ready)
133
+ for (const item of spec.items) {
134
+ await page
135
+ .locator('#o')
136
+ .evaluate(
137
+ (el, markupHtml) => (el.innerHTML = markupHtml),
138
+ markup(item, spec.width, spec.height, s)
139
+ )
140
+ await page.evaluate(() => document.fonts.ready)
141
+ const el = page.locator('#o > *')
142
+ await el.screenshot({ path: path.join(outDir, `${item.id}.png`), omitBackground: true })
143
+ const box = await el.boundingBox()
144
+ sizes[item.id] = { w: Math.round(box.width), h: Math.round(box.height) }
145
+ }
146
+ } finally {
147
+ await browser.close()
148
+ }
149
+ writeFileSync(path.join(outDir, 'sizes.json'), JSON.stringify(sizes))
150
+ }
151
+
152
+ await main()