ooxml-ui 1.3.0 → 1.4.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 (60) hide show
  1. package/custom-elements.json +101 -2
  2. package/dist/chrome/find-bar.d.ts +85 -0
  3. package/dist/chrome/find-bar.d.ts.map +1 -1
  4. package/dist/chrome/find-replace-fields.d.ts +21 -0
  5. package/dist/chrome/find-replace-fields.d.ts.map +1 -0
  6. package/dist/{chunk-723JC3OC.js → chunk-BOIZWKM7.js} +154 -48
  7. package/dist/{chunk-5OFAJDMQ.js → chunk-L4XGRNHF.js} +1 -1
  8. package/dist/{chunk-V6P6KZCO.js → chunk-R3LV6SGC.js} +2 -2
  9. package/dist/clipboard-worker.js +21 -0
  10. package/dist/controls.d.ts +1 -1
  11. package/dist/controls.d.ts.map +1 -1
  12. package/dist/controls.js +1 -1
  13. package/dist/docx.js +1 -1
  14. package/dist/index.js +3 -3
  15. package/dist/keytips.d.ts.map +1 -1
  16. package/dist/menu/menu-button.d.ts +11 -1
  17. package/dist/menu/menu-button.d.ts.map +1 -1
  18. package/dist/teams.js +2 -2
  19. package/dist/visio/binding.d.ts +10 -2
  20. package/dist/visio/clipboard-capture.d.ts +39 -0
  21. package/dist/visio/clipboard-worker.d.ts +1 -0
  22. package/dist/visio/controller.d.ts +45 -8
  23. package/dist/visio/creation-token.d.ts +26 -0
  24. package/dist/visio/index.d.ts +3 -1
  25. package/dist/visio/replacement-token.d.ts +56 -0
  26. package/dist/visio/ribbon-action.d.ts +61 -2
  27. package/dist/visio/ribbon-parts.d.ts +3 -2
  28. package/dist/visio/ribbon-router.d.ts +14 -1
  29. package/dist/visio/ribbon-style-options.d.ts +5 -0
  30. package/dist/visio/viewer-arrangement.d.ts +13 -0
  31. package/dist/visio/viewer-backstage.d.ts +1 -0
  32. package/dist/visio/viewer-clipboard.d.ts +21 -0
  33. package/dist/visio/viewer-commands.d.ts +5 -0
  34. package/dist/visio/viewer-draw-tool.d.ts +9 -29
  35. package/dist/visio/viewer-drawing-gesture.d.ts +36 -0
  36. package/dist/visio/viewer-duplication.d.ts +11 -0
  37. package/dist/visio/viewer-element.d.ts +11 -1
  38. package/dist/visio/viewer-formatting.d.ts +12 -0
  39. package/dist/visio/viewer-gesture-overlays.d.ts +2 -0
  40. package/dist/visio/viewer-handle-events.d.ts +3 -0
  41. package/dist/visio/viewer-layers.d.ts +1 -2
  42. package/dist/visio/viewer-movement-preview.d.ts +7 -0
  43. package/dist/visio/viewer-new-drawing.d.ts +5 -0
  44. package/dist/visio/viewer-page-point.d.ts +6 -0
  45. package/dist/visio/viewer-paint-dialog.d.ts +28 -0
  46. package/dist/visio/viewer-paint-menu.d.ts +4 -0
  47. package/dist/visio/viewer-paint-properties.d.ts +13 -0
  48. package/dist/visio/viewer-pointer-gestures.d.ts +14 -0
  49. package/dist/visio/viewer-replace-status.d.ts +6 -0
  50. package/dist/visio/viewer-replace.d.ts +14 -0
  51. package/dist/visio/viewer-resize-frame.d.ts +9 -0
  52. package/dist/visio/viewer-resize-handles.d.ts +14 -0
  53. package/dist/visio/viewer-search.d.ts +15 -0
  54. package/dist/visio/viewer-size-position.d.ts +13 -0
  55. package/dist/visio/viewer-text-draft.d.ts +9 -0
  56. package/dist/visio/viewer-text-tool.d.ts +17 -0
  57. package/dist/visio/worker-clipboard.d.ts +16 -0
  58. package/dist/visio.js +5948 -2618
  59. package/dist/xlsx.js +4 -4
  60. package/package.json +2 -2
@@ -1160,7 +1160,7 @@
1160
1160
  "name": "OfficeUiFindBar",
1161
1161
  "tagName": "office-ui-find-bar",
1162
1162
  "customElement": true,
1163
- "description": "`<office-ui-find-bar>`: Office's on-demand Find bar under the ribbon. Shown while `open`; `show()` opens it and selects the query. Enter steps to the next result, Shift+Enter to the previous; Escape clears a query, or closes the bar when it is already empty. Attributes: `open`, `label`, `input-label`, `placeholder`, `maxlength`, `disabled`, `navigation-disabled`, `previous-label`, `next-label`, `close-label`. Properties: `value`, `status`, `statusTitle`. Events: `office-find-input` `{ query }`, `office-find-step` `{ direction }`, `office-find-close`.",
1163
+ "description": "`<office-ui-find-bar>`: Office's on-demand Find bar under the ribbon. Shown while `open`; `show()` opens it and selects the query. Enter steps to the next result, Shift+Enter to the previous; Escape clears a query, or closes the bar when it is already empty. Attributes: `open`, `label`, `input-label`, `placeholder`, `maxlength`, `disabled`, `navigation-disabled`, `previous-label`, `next-label`, `close-label`. Properties: `value`, `status`, `statusTitle`. Events: `office-find-input` `{ query }`, `office-find-step` `{ direction }`, `office-find-close`. Opt-in `replace-mode` adds a multiline `replacement`, `scope`/`scopeOptions`, `matchCase`, `match-case-disabled`, `replace-disabled`, `replace-all-disabled`, `replacement-maxlength` and inert `error` text. `office-find-options` reports replacement/scope/matchCase; `office-find-replace` requests current/all. The host owns matching and edit transactions.",
1164
1164
  "attributes": [
1165
1165
  {
1166
1166
  "name": "close-label"
@@ -1174,6 +1174,12 @@
1174
1174
  {
1175
1175
  "name": "label"
1176
1176
  },
1177
+ {
1178
+ "name": "match-case"
1179
+ },
1180
+ {
1181
+ "name": "match-case-disabled"
1182
+ },
1177
1183
  {
1178
1184
  "name": "maxlength"
1179
1185
  },
@@ -1191,6 +1197,18 @@
1191
1197
  },
1192
1198
  {
1193
1199
  "name": "previous-label"
1200
+ },
1201
+ {
1202
+ "name": "replace-all-disabled"
1203
+ },
1204
+ {
1205
+ "name": "replace-disabled"
1206
+ },
1207
+ {
1208
+ "name": "replace-mode"
1209
+ },
1210
+ {
1211
+ "name": "replacement-maxlength"
1194
1212
  }
1195
1213
  ],
1196
1214
  "members": [
@@ -1209,6 +1227,10 @@
1209
1227
  "text": "boolean"
1210
1228
  }
1211
1229
  },
1230
+ {
1231
+ "kind": "field",
1232
+ "name": "error"
1233
+ },
1212
1234
  {
1213
1235
  "kind": "field",
1214
1236
  "name": "inputLabel",
@@ -1224,6 +1246,22 @@
1224
1246
  "text": "string"
1225
1247
  }
1226
1248
  },
1249
+ {
1250
+ "kind": "field",
1251
+ "name": "matchCase",
1252
+ "type": {
1253
+ "text": "boolean"
1254
+ },
1255
+ "attribute": "match-case"
1256
+ },
1257
+ {
1258
+ "kind": "field",
1259
+ "name": "matchCaseDisabled",
1260
+ "type": {
1261
+ "text": "boolean"
1262
+ },
1263
+ "attribute": "match-case-disabled"
1264
+ },
1227
1265
  {
1228
1266
  "kind": "field",
1229
1267
  "name": "maxlength",
@@ -1269,6 +1307,50 @@
1269
1307
  },
1270
1308
  "attribute": "previous-label"
1271
1309
  },
1310
+ {
1311
+ "kind": "field",
1312
+ "name": "replaceAllDisabled",
1313
+ "type": {
1314
+ "text": "boolean"
1315
+ },
1316
+ "attribute": "replace-all-disabled"
1317
+ },
1318
+ {
1319
+ "kind": "field",
1320
+ "name": "replaceDisabled",
1321
+ "type": {
1322
+ "text": "boolean"
1323
+ },
1324
+ "attribute": "replace-disabled"
1325
+ },
1326
+ {
1327
+ "kind": "field",
1328
+ "name": "replacement"
1329
+ },
1330
+ {
1331
+ "kind": "field",
1332
+ "name": "replacementMaxlength",
1333
+ "type": {
1334
+ "text": "number"
1335
+ },
1336
+ "attribute": "replacement-maxlength"
1337
+ },
1338
+ {
1339
+ "kind": "field",
1340
+ "name": "replaceMode",
1341
+ "type": {
1342
+ "text": "boolean"
1343
+ },
1344
+ "attribute": "replace-mode"
1345
+ },
1346
+ {
1347
+ "kind": "field",
1348
+ "name": "scope"
1349
+ },
1350
+ {
1351
+ "kind": "field",
1352
+ "name": "scopeOptions"
1353
+ },
1272
1354
  {
1273
1355
  "kind": "field",
1274
1356
  "name": "status"
@@ -1289,6 +1371,12 @@
1289
1371
  {
1290
1372
  "name": "office-find-input"
1291
1373
  },
1374
+ {
1375
+ "name": "office-find-options"
1376
+ },
1377
+ {
1378
+ "name": "office-find-replace"
1379
+ },
1292
1380
  {
1293
1381
  "name": "office-find-step"
1294
1382
  }
@@ -1413,7 +1501,7 @@
1413
1501
  "name": "OfficeUiMenuButton",
1414
1502
  "tagName": "office-ui-menu-button",
1415
1503
  "customElement": true,
1416
- "description": "Dropdown command with a menu of `office-ui-menu-item` children (Office's Find, Layers, Align). With a `command` attribute it is a split button: the main part emits that command and the caret opens the menu. Attributes: `label`, `icon`, `command`, `variant=\"stacked\"`, `icon-only`, `disabled`, `title`, `keyshortcuts`. The menu uses the top layer (`popover`) so ribbon overflow never clips it. Keyboard: Enter, Space or ArrowDown open; arrows, Home and End move; Escape and Tab close; focus returns to the trigger. Choosing an item closes the menu; its `office-command` bubbles to the host.",
1504
+ "description": "Dropdown command with a menu of `office-ui-menu-item` children (Office's Find, Layers, Align). With a `command` attribute it is a split button: the main part emits that command and the caret opens the menu. Attributes: `label`, `icon`, `command`, `variant=\"stacked\"`, `icon-only`, `disabled`, `main-disabled` (split command only), `title`, `keyshortcuts`. The menu uses the top layer (`popover`) so ribbon overflow never clips it. Keyboard: Enter, Space or ArrowDown open; arrows, Home and End move; Escape and Tab close; focus returns to the trigger. Choosing an item closes the menu; its `office-command` bubbles to the host.",
1417
1505
  "attributes": [
1418
1506
  {
1419
1507
  "name": "command"
@@ -1433,6 +1521,9 @@
1433
1521
  {
1434
1522
  "name": "label"
1435
1523
  },
1524
+ {
1525
+ "name": "main-disabled"
1526
+ },
1436
1527
  {
1437
1528
  "name": "submenu"
1438
1529
  },
@@ -1484,6 +1575,14 @@
1484
1575
  "text": "string"
1485
1576
  }
1486
1577
  },
1578
+ {
1579
+ "kind": "field",
1580
+ "name": "mainDisabled",
1581
+ "type": {
1582
+ "text": "boolean"
1583
+ },
1584
+ "attribute": "main-disabled"
1585
+ },
1487
1586
  {
1488
1587
  "kind": "field",
1489
1588
  "name": "open"
@@ -1,10 +1,19 @@
1
1
  import { OfficeElement } from '../base.js';
2
+ import type { OfficeSelectOption } from '../form/select.js';
2
3
  export type OfficeFindInputEvent = CustomEvent<{
3
4
  query: string;
4
5
  }>;
5
6
  export type OfficeFindStepEvent = CustomEvent<{
6
7
  direction: 'next' | 'previous';
7
8
  }>;
9
+ export type OfficeFindOptionsEvent = CustomEvent<{
10
+ replacement: string;
11
+ scope: string;
12
+ matchCase: boolean;
13
+ }>;
14
+ export type OfficeFindReplaceEvent = CustomEvent<{
15
+ mode: 'current' | 'all';
16
+ }>;
8
17
  /**
9
18
  * `<office-ui-find-bar>`: Office's on-demand Find bar under the ribbon. Shown while `open`;
10
19
  * `show()` opens it and selects the query. Enter steps to the next result, Shift+Enter to the
@@ -12,6 +21,10 @@ export type OfficeFindStepEvent = CustomEvent<{
12
21
  * `open`, `label`, `input-label`, `placeholder`, `maxlength`, `disabled`, `navigation-disabled`,
13
22
  * `previous-label`, `next-label`, `close-label`. Properties: `value`, `status`, `statusTitle`.
14
23
  * Events: `office-find-input` `{ query }`, `office-find-step` `{ direction }`, `office-find-close`.
24
+ * Opt-in `replace-mode` adds a multiline `replacement`, `scope`/`scopeOptions`, `matchCase`,
25
+ * `match-case-disabled`, `replace-disabled`, `replace-all-disabled`, `replacement-maxlength`
26
+ * and inert `error` text. `office-find-options` reports replacement/scope/matchCase;
27
+ * `office-find-replace` requests current/all. The host owns matching and edit transactions.
15
28
  */
16
29
  export declare class OfficeUiFindBar extends OfficeElement {
17
30
  static shadowRootOptions: {
@@ -83,6 +96,67 @@ export declare class OfficeUiFindBar extends OfficeElement {
83
96
  statusTitle: {
84
97
  attribute: boolean;
85
98
  };
99
+ replaceMode: {
100
+ type: BooleanConstructor;
101
+ reflect: true;
102
+ converter: {
103
+ fromAttribute: (value: string | null) => boolean;
104
+ toAttribute: (value: unknown) => string | null;
105
+ };
106
+ attribute: string;
107
+ };
108
+ replacement: {
109
+ attribute: boolean;
110
+ };
111
+ replacementMaxlength: {
112
+ attribute: string;
113
+ type: NumberConstructor;
114
+ };
115
+ scope: {
116
+ attribute: boolean;
117
+ };
118
+ scopeOptions: {
119
+ attribute: boolean;
120
+ };
121
+ matchCase: {
122
+ type: BooleanConstructor;
123
+ reflect: true;
124
+ converter: {
125
+ fromAttribute: (value: string | null) => boolean;
126
+ toAttribute: (value: unknown) => string | null;
127
+ };
128
+ attribute: string;
129
+ };
130
+ matchCaseDisabled: {
131
+ type: BooleanConstructor;
132
+ reflect: true;
133
+ converter: {
134
+ fromAttribute: (value: string | null) => boolean;
135
+ toAttribute: (value: unknown) => string | null;
136
+ };
137
+ attribute: string;
138
+ };
139
+ replaceDisabled: {
140
+ type: BooleanConstructor;
141
+ reflect: true;
142
+ converter: {
143
+ fromAttribute: (value: string | null) => boolean;
144
+ toAttribute: (value: unknown) => string | null;
145
+ };
146
+ attribute: string;
147
+ };
148
+ replaceAllDisabled: {
149
+ type: BooleanConstructor;
150
+ reflect: true;
151
+ converter: {
152
+ fromAttribute: (value: string | null) => boolean;
153
+ toAttribute: (value: unknown) => string | null;
154
+ };
155
+ attribute: string;
156
+ };
157
+ error: {
158
+ attribute: boolean;
159
+ };
86
160
  };
87
161
  open: boolean;
88
162
  disabled: boolean;
@@ -97,6 +171,16 @@ export declare class OfficeUiFindBar extends OfficeElement {
97
171
  value: string;
98
172
  status: string;
99
173
  statusTitle: string;
174
+ replaceMode: boolean;
175
+ replacement: string;
176
+ replacementMaxlength: number;
177
+ scope: string;
178
+ scopeOptions: OfficeSelectOption[];
179
+ matchCase: boolean;
180
+ matchCaseDisabled: boolean;
181
+ replaceDisabled: boolean;
182
+ replaceAllDisabled: boolean;
183
+ error: string;
100
184
  constructor();
101
185
  private get input();
102
186
  /** Open, focus the field and select its query. */
@@ -106,6 +190,7 @@ export declare class OfficeUiFindBar extends OfficeElement {
106
190
  private step;
107
191
  private onInput;
108
192
  private onKey;
193
+ private replaceOptions;
109
194
  protected render(): import("lit").TemplateResult<1>;
110
195
  }
111
196
  export declare const defineFindBar: import("../registry.js").Definer;
@@ -1 +1 @@
1
- {"version":3,"file":"find-bar.d.ts","sourceRoot":"","sources":["../../src/chrome/find-bar.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAuB,MAAM,SAAS,CAAC;AAI7D,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAAE,KAAK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EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IAEtB,cA6BC;IAED,OAAO,KAAK,KAAK,GAEhB;IAED,kDAAkD;IAClD,IAAI,IAAI,IAAI,CAIX;IAED,0CAA0C;IAC1C,KAAK,IAAI,IAAI,CAIZ;IAED,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,cAAc;IAiBtB,UAAmB,MAAM,oCAqFxB;CACD;AAED,eAAO,MAAM,aAAa,+BAAuD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { OfficeSelectOption } from '../form/select.js';
2
+ export interface FindReplaceFields {
3
+ replacement: string;
4
+ replacementMaxlength: number;
5
+ scope: string;
6
+ scopeOptions: OfficeSelectOption[];
7
+ matchCase: boolean;
8
+ matchCaseDisabled: boolean;
9
+ disabled: boolean;
10
+ replaceDisabled: boolean;
11
+ replaceAllDisabled: boolean;
12
+ options(next: {
13
+ replacement?: string;
14
+ scope?: string;
15
+ matchCase?: boolean;
16
+ }): void;
17
+ replace(mode: 'current' | 'all'): void;
18
+ }
19
+ /** Optional product-neutral Replace controls; matching, scopes and transactions belong to core. */
20
+ export declare function findReplaceFields(state: FindReplaceFields): import("lit").TemplateResult<1>;
21
+ //# sourceMappingURL=find-replace-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-replace-fields.d.ts","sourceRoot":"","sources":["../../src/chrome/find-replace-fields.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,WAAW,iBAAiB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,IAAI,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACnF,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;CACvC;AAED,mGAAmG;AACnG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,mCAgDzD"}
@@ -873,7 +873,56 @@ var OfficeUiBackstage = class extends OfficeElement {
873
873
  var defineBackstage = definer("office-ui-backstage", () => OfficeUiBackstage);
874
874
 
875
875
  // raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/chrome/find-bar.css?raw
876
- var find_bar_default = ":host {\n display: flex;\n align-items: center;\n gap: var(--office-space-2);\n min-height: var(--office-find-bar-height);\n padding: var(--office-space-1) var(--office-space-2) var(--office-space-1) var(--office-space-3);\n border-bottom: var(--office-border-width) solid var(--office-border);\n background: var(--office-surface);\n color: var(--office-foreground);\n font: var(--office-font-size-sm) var(--office-font);\n}\n:host(:not([open])) {\n display: none;\n}\n[role='search'] {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1);\n min-width: 0;\n max-width: var(--office-find-max-width);\n}\nlabel {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1-5);\n min-width: 0;\n}\ninput {\n flex: 1;\n min-width: 0;\n min-height: var(--office-input-height);\n padding: var(--office-space-0) var(--office-space-1-5);\n font: inherit;\n color: inherit;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\nbutton {\n min-height: var(--office-input-height);\n padding: var(--office-space-0) var(--office-space-2);\n font: inherit;\n color: inherit;\n cursor: pointer;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\nbutton:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.status {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--office-muted-foreground);\n}\n.close {\n margin-inline-start: auto;\n width: var(--office-target-size);\n padding: 0;\n border-color: transparent;\n background: transparent;\n font-size: var(--office-font-size-xl);\n line-height: 1;\n}\ninput:focus-visible,\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(var(--office-focus-offset) / 2);\n}\n@media (max-width: 760px) {\n :host {\n flex-wrap: wrap;\n }\n [role='search'] {\n flex-wrap: wrap;\n }\n}\n";
876
+ var find_bar_default = ":host {\n display: flex;\n align-items: center;\n gap: var(--office-space-2);\n min-height: var(--office-find-bar-height);\n padding: var(--office-space-1) var(--office-space-2) var(--office-space-1) var(--office-space-3);\n border-bottom: var(--office-border-width) solid var(--office-border);\n background: var(--office-surface);\n color: var(--office-foreground);\n font: var(--office-font-size-sm) var(--office-font);\n}\n:host(:not([open])) {\n display: none;\n}\n.find-content {\n flex: 1;\n min-width: 0;\n}\n.replace-fields {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--office-space-2);\n margin-top: var(--office-space-2);\n}\n.replace-fields label {\n flex: 0 1 auto;\n}\n.replace-fields label:first-child {\n flex: 1;\n}\n.replace-fields textarea {\n min-width: 120px;\n width: 100%;\n box-sizing: border-box;\n min-height: var(--office-input-height);\n padding: var(--office-space-1);\n font: inherit;\n color: inherit;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\n.replace-fields office-ui-select {\n min-width: 150px;\n}\n.find-error {\n color: var(--office-error, #b00020);\n margin-bottom: 0;\n}\n[role='search'] {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1);\n min-width: 0;\n max-width: var(--office-find-max-width);\n}\nlabel {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1-5);\n min-width: 0;\n}\ninput {\n flex: 1;\n min-width: 0;\n min-height: var(--office-input-height);\n padding: var(--office-space-0) var(--office-space-1-5);\n font: inherit;\n color: inherit;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\nbutton {\n min-height: var(--office-input-height);\n padding: var(--office-space-0) var(--office-space-2);\n font: inherit;\n color: inherit;\n cursor: pointer;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\nbutton:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.status {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--office-muted-foreground);\n}\n.close {\n margin-inline-start: auto;\n width: var(--office-target-size);\n padding: 0;\n border-color: transparent;\n background: transparent;\n font-size: var(--office-font-size-xl);\n line-height: 1;\n}\ninput:focus-visible,\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(var(--office-focus-offset) / 2);\n}\n@media (max-width: 760px) {\n :host {\n flex-wrap: wrap;\n }\n [role='search'] {\n flex-wrap: wrap;\n }\n}\n";
877
+ function findReplaceFields(state) {
878
+ return html`<div class="replace-fields">
879
+ <label
880
+ >Replace with
881
+ <textarea
882
+ rows="2"
883
+ aria-label="Replace with"
884
+ spellcheck="false"
885
+ maxlength=${ifDefined(state.replacementMaxlength > 0 ? String(state.replacementMaxlength) : void 0)}
886
+ .value=${live(state.replacement)}
887
+ ?disabled=${state.disabled}
888
+ @input=${(event) => state.options({ replacement: event.target.value })}
889
+ ></textarea>
890
+ </label>
891
+ <label
892
+ >Search in
893
+ <office-ui-select
894
+ aria-label="Search scope"
895
+ .value=${state.scope}
896
+ .options=${state.scopeOptions}
897
+ ?disabled=${state.disabled}
898
+ @change=${(event) => state.options({ scope: event.currentTarget.value })}
899
+ ></office-ui-select
900
+ ></label>
901
+ <label class="match-case"
902
+ ><office-ui-checkbox
903
+ aria-label="Match case"
904
+ .checked=${state.matchCase}
905
+ ?disabled=${state.disabled || state.matchCaseDisabled}
906
+ @change=${(event) => state.options({ matchCase: event.currentTarget.checked })}
907
+ ></office-ui-checkbox
908
+ >Match case</label
909
+ >
910
+ <button
911
+ type="button"
912
+ data-action="replace"
913
+ ?disabled=${state.disabled || state.replaceDisabled}
914
+ @click=${() => state.replace("current")}
915
+ >Replace</button
916
+ >
917
+ <button
918
+ type="button"
919
+ data-action="replace-all"
920
+ ?disabled=${state.disabled || state.replaceAllDisabled}
921
+ @click=${() => state.replace("all")}
922
+ >Replace All</button
923
+ >
924
+ </div>`;
925
+ }
877
926
 
878
927
  // src/chrome/find-bar.ts
879
928
  var OfficeUiFindBar = class extends OfficeElement {
@@ -892,7 +941,17 @@ var OfficeUiFindBar = class extends OfficeElement {
892
941
  closeLabel: { attribute: "close-label", type: String },
893
942
  value: { attribute: false },
894
943
  status: { attribute: false },
895
- statusTitle: { attribute: false }
944
+ statusTitle: { attribute: false },
945
+ replaceMode: { attribute: "replace-mode", ...flag },
946
+ replacement: { attribute: false },
947
+ replacementMaxlength: { attribute: "replacement-maxlength", type: Number },
948
+ scope: { attribute: false },
949
+ scopeOptions: { attribute: false },
950
+ matchCase: { attribute: "match-case", ...flag },
951
+ matchCaseDisabled: { attribute: "match-case-disabled", ...flag },
952
+ replaceDisabled: { attribute: "replace-disabled", ...flag },
953
+ replaceAllDisabled: { attribute: "replace-all-disabled", ...flag },
954
+ error: { attribute: false }
896
955
  };
897
956
  constructor() {
898
957
  super();
@@ -909,6 +968,20 @@ var OfficeUiFindBar = class extends OfficeElement {
909
968
  this.value = "";
910
969
  this.status = "";
911
970
  this.statusTitle = "";
971
+ this.replaceMode = false;
972
+ this.replacement = "";
973
+ this.replacementMaxlength = 0;
974
+ this.scope = "";
975
+ this.scopeOptions = [];
976
+ this.matchCase = true;
977
+ this.matchCaseDisabled = false;
978
+ this.replaceDisabled = false;
979
+ this.replaceAllDisabled = false;
980
+ this.error = "";
981
+ this.addEventListener("keydown", (event) => {
982
+ if (present(this.replaceMode) && event.key === "Escape" && !event.defaultPrevented)
983
+ this.onKey(event);
984
+ });
912
985
  }
913
986
  get input() {
914
987
  return this.renderRoot.querySelector("input");
@@ -946,54 +1019,85 @@ var OfficeUiFindBar = class extends OfficeElement {
946
1019
  } else this.close();
947
1020
  }
948
1021
  }
1022
+ replaceOptions(next) {
1023
+ if (present(this.disabled)) return;
1024
+ if (next.replacement !== void 0) this.replacement = next.replacement;
1025
+ if (next.scope !== void 0) this.scope = next.scope;
1026
+ if (next.matchCase !== void 0 && !present(this.matchCaseDisabled))
1027
+ this.matchCase = next.matchCase;
1028
+ this.fire("office-find-options", {
1029
+ replacement: this.replacement,
1030
+ scope: this.scope,
1031
+ matchCase: this.matchCase
1032
+ });
1033
+ }
949
1034
  render() {
950
1035
  const max = Number(this.maxlength);
951
1036
  const disabled = present(this.disabled);
952
1037
  const stuck = present(this.navigationDisabled) || disabled;
953
1038
  const close = this.closeLabel ?? "Close Find";
954
1039
  return html`
955
- <div role="search" aria-label=${this.label ?? "Find"}>
956
- <label>
957
- Find
958
- <input
959
- type="search"
960
- autocomplete="off"
961
- spellcheck="false"
962
- aria-describedby="status"
963
- aria-label=${this.inputLabel ?? "Find"}
964
- placeholder=${this.placeholder ?? ""}
965
- maxlength=${ifDefined(Number.isInteger(max) && max > 0 ? String(max) : void 0)}
966
- .value=${live(this.value)}
967
- ?disabled=${disabled}
968
- @input=${this.onInput}
969
- @keydown=${this.onKey}
970
- />
971
- </label>
972
- <button
973
- type="button"
974
- data-action="previous"
975
- aria-label=${this.previousLabel ?? "Previous result"}
976
- ?disabled=${stuck}
977
- @click=${() => this.step("previous")}
978
- >Previous</button
979
- >
980
- <button
981
- type="button"
982
- data-action="next"
983
- aria-label=${this.nextLabel ?? "Next result"}
984
- ?disabled=${stuck}
985
- @click=${() => this.step("next")}
986
- >Next</button
987
- >
988
- <span
989
- id="status"
990
- class="status"
991
- role="status"
992
- aria-live="polite"
993
- aria-atomic="true"
994
- title=${this.statusTitle}
995
- >${this.status}</span
996
- >
1040
+ <div class="find-content">
1041
+ <div role="search" aria-label=${this.label ?? "Find"}>
1042
+ <label>
1043
+ Find
1044
+ <input
1045
+ type="search"
1046
+ autocomplete="off"
1047
+ spellcheck="false"
1048
+ aria-describedby="status"
1049
+ aria-label=${this.inputLabel ?? "Find"}
1050
+ placeholder=${this.placeholder ?? ""}
1051
+ maxlength=${ifDefined(Number.isInteger(max) && max > 0 ? String(max) : void 0)}
1052
+ .value=${live(this.value)}
1053
+ ?disabled=${disabled}
1054
+ @input=${this.onInput}
1055
+ @keydown=${this.onKey}
1056
+ />
1057
+ </label>
1058
+ <button
1059
+ type="button"
1060
+ data-action="previous"
1061
+ aria-label=${this.previousLabel ?? "Previous result"}
1062
+ ?disabled=${stuck}
1063
+ @click=${() => this.step("previous")}
1064
+ >Previous</button
1065
+ >
1066
+ <button
1067
+ type="button"
1068
+ data-action="next"
1069
+ aria-label=${this.nextLabel ?? "Next result"}
1070
+ ?disabled=${stuck}
1071
+ @click=${() => this.step("next")}
1072
+ >Next</button
1073
+ >
1074
+ <span
1075
+ id="status"
1076
+ class="status"
1077
+ role="status"
1078
+ aria-live="polite"
1079
+ aria-atomic="true"
1080
+ title=${this.statusTitle}
1081
+ >${this.status}</span
1082
+ >
1083
+ </div>
1084
+ ${present(this.replaceMode) ? findReplaceFields({
1085
+ replacement: this.replacement,
1086
+ replacementMaxlength: this.replacementMaxlength,
1087
+ scope: this.scope,
1088
+ scopeOptions: this.scopeOptions,
1089
+ matchCase: this.matchCase,
1090
+ matchCaseDisabled: present(this.matchCaseDisabled),
1091
+ disabled,
1092
+ replaceDisabled: present(this.replaceDisabled),
1093
+ replaceAllDisabled: present(this.replaceAllDisabled),
1094
+ options: (next) => this.replaceOptions(next),
1095
+ replace: (mode) => {
1096
+ if (!disabled && !present(mode === "current" ? this.replaceDisabled : this.replaceAllDisabled))
1097
+ this.fire("office-find-replace", { mode });
1098
+ }
1099
+ }) : null}
1100
+ ${this.error ? html`<p class="find-error" role="alert">${this.error}</p>` : null}
997
1101
  </div>
998
1102
  <button
999
1103
  type="button"
@@ -3442,6 +3546,7 @@ var OfficeUiMenuButton = class _OfficeUiMenuButton extends OfficeElement {
3442
3546
  command: { type: String, reflect: true },
3443
3547
  keyshortcuts: { type: String },
3444
3548
  disabled: flag,
3549
+ mainDisabled: { attribute: "main-disabled", ...flag },
3445
3550
  submenu: flag,
3446
3551
  iconOnly: { attribute: "icon-only", ...flag },
3447
3552
  open: { state: true }
@@ -3458,6 +3563,7 @@ var OfficeUiMenuButton = class _OfficeUiMenuButton extends OfficeElement {
3458
3563
  this.command = null;
3459
3564
  this.keyshortcuts = null;
3460
3565
  this.disabled = false;
3566
+ this.mainDisabled = false;
3461
3567
  this.submenu = false;
3462
3568
  this.iconOnly = false;
3463
3569
  this.open = false;
@@ -3488,7 +3594,7 @@ var OfficeUiMenuButton = class _OfficeUiMenuButton extends OfficeElement {
3488
3594
  );
3489
3595
  }
3490
3596
  focus(options) {
3491
- this.renderRoot.querySelector(".main")?.focus(options);
3597
+ this.renderRoot.querySelector(this.split && present(this.mainDisabled) ? ".caret" : ".main")?.focus(options);
3492
3598
  }
3493
3599
  toggle() {
3494
3600
  if (present(this.submenu)) {
@@ -3561,7 +3667,7 @@ var OfficeUiMenuButton = class _OfficeUiMenuButton extends OfficeElement {
3561
3667
  this.open = false;
3562
3668
  }
3563
3669
  onMain() {
3564
- if (present(this.disabled)) return;
3670
+ if (present(this.disabled) || this.split && present(this.mainDisabled)) return;
3565
3671
  if (this.command) this.fire("office-command", { command: this.command });
3566
3672
  else this.toggle();
3567
3673
  }
@@ -3614,7 +3720,7 @@ var OfficeUiMenuButton = class _OfficeUiMenuButton extends OfficeElement {
3614
3720
  role=${ifDefined(present(this.submenu) ? "menuitem" : void 0)}
3615
3721
  tabindex=${present(this.submenu) ? -1 : 0}
3616
3722
  aria-expanded=${ifDefined(split ? void 0 : String(open))}
3617
- ?disabled=${disabled}
3723
+ ?disabled=${disabled || split && present(this.mainDisabled)}
3618
3724
  @click=${this.onMain}
3619
3725
  @keydown=${this.onTriggerKey}
3620
3726
  @pointerenter=${() => present(this.submenu) && this.show(-1)}
@@ -5050,7 +5156,7 @@ var defineZoomSlider = definer("office-ui-zoom-slider", () => OfficeUiZoomSlider
5050
5156
  // src/keytips.ts
5051
5157
  var BADGE_CSS = "position:fixed;inset:auto;margin:0;padding:0;border:0;background:transparent;overflow:visible;pointer-events:none";
5052
5158
  var TIP_CSS = `position:fixed;transform:translate(-50%,-30%);min-width:${tok("--office-icon-size")};padding:${tok("--office-space-px")} ${tok("--office-space-1")};border:${tok("--office-border-width")} solid ${tok("--office-keytip-border")};border-radius:${tok("--office-radius-xs")};background:${tok("--office-keytip-background")};color:${tok("--office-keytip-foreground")};font:${tok("--office-font-weight-bold")} ${tok("--office-font-size-xs")}/${tok("--office-icon-size")} ${tok("--office-font")};text-align:center;box-shadow:${tok("--office-shadow-sm")}`;
5053
- var isDisabled = (el) => el.hasAttribute("disabled") || el.getAttribute("aria-disabled") === "true";
5159
+ var isDisabled = (el) => el.hasAttribute("disabled") || el.getAttribute("aria-disabled") === "true" || el.matches("office-ui-menu-button[command][main-disabled]") && !!el.getAttribute("command");
5054
5160
  var visible = (el) => {
5055
5161
  const box = el.getBoundingClientRect();
5056
5162
  return box.width > 0 && box.height > 0;
@@ -1,5 +1,5 @@
1
1
  import { THEME_CSS, installOfficeUiTheme } from './chunk-56A2JK63.js';
2
- import { defineMenuButton, defineMenuItem, registerControls, defineSwitch } from './chunk-723JC3OC.js';
2
+ import { defineMenuButton, defineMenuItem, registerControls, defineSwitch } from './chunk-BOIZWKM7.js';
3
3
  import { registerIcon, getIcon } from './chunk-M6GF5ED2.js';
4
4
  import { initialsOf, definePresence } from './chunk-TWQ45BFL.js';
5
5
  import { definer, OfficeElement, controlStyles } from './chunk-IY7QJLQG.js';
@@ -1,7 +1,7 @@
1
1
  import { defineSmartArt } from './chunk-NYRRH2MD.js';
2
- import { TEAMS_TAGS, registerTeams } from './chunk-5OFAJDMQ.js';
2
+ import { TEAMS_TAGS, registerTeams } from './chunk-L4XGRNHF.js';
3
3
  import { installOfficeUiTheme } from './chunk-56A2JK63.js';
4
- import { registerControls } from './chunk-723JC3OC.js';
4
+ import { registerControls } from './chunk-BOIZWKM7.js';
5
5
  import { definePresence } from './chunk-TWQ45BFL.js';
6
6
 
7
7
  // src/index.ts
@@ -0,0 +1,21 @@
1
+ import { captureVisioClipboard, serializeVisioClipboard } from 'ooxml-core/visio';
2
+
3
+ // src/visio/clipboard-worker.ts
4
+ self.onmessage = async (event) => {
5
+ try {
6
+ const request = event.data;
7
+ const snapshot = await captureVisioClipboard(
8
+ new Uint8Array(request.bytes),
9
+ request.pageId,
10
+ request.shapeIds
11
+ );
12
+ self.postMessage({ ok: true, text: serializeVisioClipboard(snapshot) });
13
+ } catch (cause) {
14
+ const error = cause instanceof Error ? cause : new Error(String(cause));
15
+ self.postMessage({
16
+ ok: false,
17
+ message: error.message.slice(0, 4096),
18
+ code: "code" in error ? error.code : void 0
19
+ });
20
+ }
21
+ };
@@ -46,7 +46,7 @@ export type { OfficeSearchCommand } from './menu/command-search.js';
46
46
  export { OFFICE_TITLE_BAR_SEARCH_LIMIT, type OfficeQuickAccessItem, type OfficeTitleBarAutosave, type OfficeTitleBarCommand, type OfficeTitleBarPlacement, type OfficeTitleBarSearch, type OfficeTitleBarSearchDetail, type OfficeTitleBarState, type OfficeTitleBarTone, } from './chrome/title-bar.js';
47
47
  export { attachKeyTips, type KeyTipsHandle } from './keytips.js';
48
48
  export type { OfficeBackstageCloseEvent, OfficeBackstageItem, OfficeBackstageSelectEvent, } from './chrome/backstage.js';
49
- export type { OfficeFindInputEvent, OfficeFindStepEvent } from './chrome/find-bar.js';
49
+ export type { OfficeFindInputEvent, OfficeFindStepEvent, OfficeFindOptionsEvent, OfficeFindReplaceEvent, } from './chrome/find-bar.js';
50
50
  export type { OfficePrintPreviewPageEvent } from './chrome/print-preview.js';
51
51
  export { commentInitials, DEFAULT_COMMENTS_LABELS, formatCommentTime, type OfficeComment, type OfficeCommentAddDetail, type OfficeCommentDeleteDetail, type OfficeCommentEditDetail, type OfficeCommentReplyDetail, type OfficeCommentsClassNames, type OfficeCommentsLabels, type OfficeCommentThread, type OfficeThreadDetail, } from './comments/types.js';
52
52
  export { assignKeyTips, runKeyTips } from './ribbon/keytip-run.js';