ooxml-ui 1.0.0 → 1.2.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.
- package/README.md +40 -36
- package/custom-elements.json +211 -4
- package/dist/chrome/ruler.d.ts +60 -2
- package/dist/chrome/ruler.d.ts.map +1 -1
- package/dist/chrome/status-bar.d.ts +3 -1
- package/dist/chrome/status-bar.d.ts.map +1 -1
- package/dist/{chunk-T3HB5LMH.js → chunk-7FNDOWTX.js} +393 -15
- package/dist/{chunk-FLHM5Q4O.js → chunk-AYXFLBSV.js} +92 -13
- package/dist/{chunk-X7RINDJQ.js → chunk-JAJFLFAV.js} +1 -1
- package/dist/{chunk-OXKWNNNJ.js → chunk-VUB44CAJ.js} +1 -1
- package/dist/{chunk-JFJXBYRD.js → chunk-XNCWB2X6.js} +5 -0
- package/dist/{chunk-XDUYS4KK.js → chunk-Y2E22JVO.js} +1 -1
- package/dist/{chunk-ZV2Z4IWH.js → chunk-YK2DPYMU.js} +5 -2
- package/dist/{chunk-4QQASR5A.js → chunk-YP5S7DTT.js} +6 -5
- package/dist/comments/comments-pane.d.ts +116 -0
- package/dist/comments/comments-pane.d.ts.map +1 -0
- package/dist/comments/types.d.ts +80 -0
- package/dist/comments/types.d.ts.map +1 -0
- package/dist/controls.d.ts +4 -2
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +4 -4
- package/dist/docx/comments-panel.d.ts +8 -1
- package/dist/docx/image-media.d.ts +1 -1
- package/dist/docx/locales/en-ribbon.d.ts +1 -0
- package/dist/docx/locales/en.d.ts +1 -0
- package/dist/docx/localization-strings.d.ts +2 -1
- package/dist/docx/localization.d.ts +7 -1
- package/dist/docx/print-layout.d.ts +2 -2
- package/dist/docx/print-picture.d.ts +12 -0
- package/dist/docx/review-controller.d.ts +2 -0
- package/dist/docx/ruler.d.ts +7 -10
- package/dist/docx.js +289 -339
- package/dist/form/gradient-preset-gallery.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/pptx/{chart-3d-view-scene-2KRQ5667.mjs → chart-3d-view-scene-6B5TOWB6.mjs} +3 -3
- package/dist/pptx/{chart-3d-view-scene-36DMZWZ3.cjs → chart-3d-view-scene-MJ6YNT56.cjs} +37 -37
- package/dist/pptx/{chunk-YOGDIDPB.mjs → chunk-AWKKC3VW.mjs} +8 -2
- package/dist/pptx/{chunk-XQZWZMGZ.cjs → chunk-SM3CWDIQ.cjs} +7 -17
- package/dist/pptx/{chunk-CJU4P5FT.cjs → chunk-STKGUT5S.cjs} +18 -12
- package/dist/pptx/{chunk-JSBGBVBH.mjs → chunk-VRFNAF3Q.mjs} +7 -17
- package/dist/pptx/{chunk-YHA6XAB3.cjs → chunk-XIQMFSNG.cjs} +1 -1
- package/dist/pptx/{chunk-YARCML7O.mjs → chunk-XQVKQD5Z.mjs} +294 -265
- package/dist/pptx/{chunk-XWE5GSE7.mjs → chunk-YI5LH5NN.mjs} +533 -428
- package/dist/pptx/{chunk-ADOC5JLI.mjs → chunk-YMTQLZ2I.mjs} +1 -1
- package/dist/pptx/{chunk-AIL3BNZS.cjs → chunk-YRHK45AB.cjs} +301 -265
- package/dist/pptx/{chunk-FEFQTZDM.cjs → chunk-ZK344LOB.cjs} +689 -574
- package/dist/pptx/dom/elements/chart.d.ts +2 -3
- package/dist/pptx/dom/elements/chart.d.ts.map +1 -1
- package/dist/pptx/dom/elements/table.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +257 -246
- package/dist/pptx/dom/index.mjs +28 -17
- package/dist/pptx/export/html2canvas-clone.cjs +2 -2
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translator.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3035 -2991
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/render/chart-axis-range.d.ts +7 -0
- package/dist/pptx/render/chart-axis-range.d.ts.map +1 -1
- package/dist/pptx/render/chart-axis-render.d.ts +3 -1
- package/dist/pptx/render/chart-axis-render.d.ts.map +1 -1
- package/dist/pptx/render/chart-axis-style.d.ts +5 -0
- package/dist/pptx/render/chart-axis-style.d.ts.map +1 -1
- package/dist/pptx/render/chart-axis.d.ts +1 -1
- package/dist/pptx/render/chart-axis.d.ts.map +1 -1
- package/dist/pptx/render/chart-cartesian-axes.d.ts.map +1 -1
- package/dist/pptx/render/chart-cartesian-bars.d.ts +3 -3
- package/dist/pptx/render/chart-cartesian-bars.d.ts.map +1 -1
- package/dist/pptx/render/chart-cartesian-percent-stacked.d.ts.map +1 -1
- package/dist/pptx/render/chart-cartesian.d.ts.map +1 -1
- package/dist/pptx/render/chart-combo-stock.cjs +3 -3
- package/dist/pptx/render/chart-combo-stock.mjs +1 -1
- package/dist/pptx/render/chart-combo.d.ts.map +1 -1
- package/dist/pptx/render/chart-gridlines-toggle.d.ts +13 -1
- package/dist/pptx/render/chart-gridlines-toggle.d.ts.map +1 -1
- package/dist/pptx/render/chart-helpers.d.ts +13 -13
- package/dist/pptx/render/chart-helpers.d.ts.map +1 -1
- package/dist/pptx/render/chart-horizontal-bars-helpers.d.ts +7 -3
- package/dist/pptx/render/chart-horizontal-bars-helpers.d.ts.map +1 -1
- package/dist/pptx/render/chart-horizontal-bars.d.ts.map +1 -1
- package/dist/pptx/render/chart-interaction-stacked.d.ts.map +1 -1
- package/dist/pptx/render/chart-overlays.cjs +7 -7
- package/dist/pptx/render/chart-overlays.mjs +1 -1
- package/dist/pptx/render/chart-palette.d.ts +5 -14
- package/dist/pptx/render/chart-palette.d.ts.map +1 -1
- package/dist/pptx/render/chart-quick-action-styles.d.ts +5 -3
- package/dist/pptx/render/chart-quick-action-styles.d.ts.map +1 -1
- package/dist/pptx/render/chart-scatter-x-axis.d.ts.map +1 -1
- package/dist/pptx/render/chart-style-palette.d.ts +52 -0
- package/dist/pptx/render/chart-style-palette.d.ts.map +1 -0
- package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
- package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
- package/dist/pptx/render/chart-view-model-bars.d.ts +31 -1
- package/dist/pptx/render/chart-view-model-bars.d.ts.map +1 -1
- package/dist/pptx/render/chart-view-model-build.d.ts.map +1 -1
- package/dist/pptx/render/chart-view-model.cjs +53 -41
- package/dist/pptx/render/chart-view-model.mjs +1 -1
- package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
- package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
- package/dist/pptx/render/connector-elbow-geometry.d.ts +7 -43
- package/dist/pptx/render/connector-elbow-geometry.d.ts.map +1 -1
- package/dist/pptx/render/foreign-object-svg-document.d.ts +12 -0
- package/dist/pptx/render/foreign-object-svg-document.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +2 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-css.d.ts +3 -2
- package/dist/pptx/render/table-cell-css.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-edit.d.ts +1 -1
- package/dist/pptx/render/table-cell-edit.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts +29 -0
- package/dist/pptx/render/table-cell-paragraphs.d.ts.map +1 -0
- package/dist/pptx/render/table-style.d.ts +2 -0
- package/dist/pptx/render/table-style.d.ts.map +1 -1
- package/dist/pptx/render/title-bar.d.ts +5 -0
- package/dist/pptx/render/title-bar.d.ts.map +1 -1
- package/dist/pptx/render/viewer-root-options.d.ts +54 -0
- package/dist/pptx/render/viewer-root-options.d.ts.map +1 -0
- package/dist/pptx/web-components/office-token-bridge.d.ts.map +1 -1
- package/dist/pptx/web-components/registration-contract.d.ts.map +1 -1
- package/dist/presence.js +3 -3
- package/dist/registry.d.ts +2 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/ribbon/ribbon-tabs.d.ts +2 -1
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/smartart/smartart-svg.d.ts +3 -2
- package/dist/smartart.js +3 -3
- package/dist/suite/attachment-store.d.ts +13 -0
- package/dist/suite/document-store.d.ts +31 -0
- package/dist/suite/index.d.ts +2 -0
- package/dist/suite.js +132 -1
- package/dist/teams/app/channel-tab.d.ts +5 -0
- package/dist/teams/chat-composer.d.ts +3 -0
- package/dist/teams.js +6 -6
- package/dist/theme.js +2 -2
- package/dist/tokens.d.ts +5 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/visio/styles/index.d.ts +2 -0
- package/dist/visio/styles/theme.d.ts +11 -0
- package/dist/visio/styles.d.ts +2 -2
- package/dist/visio.js +76 -25
- package/dist/xlsx/backstage/index.d.ts +4 -1
- package/dist/xlsx/backstage/pages-share.d.ts +19 -0
- package/dist/xlsx/backstage/parts.d.ts +3 -0
- package/dist/xlsx/chart-fill-binding.d.ts +2 -2
- package/dist/xlsx/chart-series-gradient-type.d.ts +3 -2
- package/dist/xlsx/collaboration-session.d.ts +9 -0
- package/dist/xlsx/collaboration-types.d.ts +41 -0
- package/dist/xlsx/collaboration.d.ts +56 -0
- package/dist/xlsx/component.d.ts +8 -0
- package/dist/xlsx/dialogs/comments-list.d.ts +4 -0
- package/dist/xlsx/dialogs/help-dialogs.d.ts +1 -1
- package/dist/xlsx/editor-core.d.ts +3 -0
- package/dist/xlsx/element-api.d.ts +19 -1
- package/dist/xlsx/events.d.ts +4 -1
- package/dist/xlsx/grid/remote-layer.d.ts +3 -0
- package/dist/xlsx/grid/sparkline.d.ts +3 -0
- package/dist/xlsx/grid/styles.d.ts +1 -1
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/ribbon-actions.d.ts +21 -0
- package/dist/xlsx/shell-commands.d.ts +1 -1
- package/dist/xlsx/title-bar.d.ts +4 -2
- package/dist/xlsx.js +712 -90
- package/package.json +3 -3
- package/dist/pptx/web-components/status-bar-styles.d.ts +0 -3
- package/dist/pptx/web-components/status-bar-styles.d.ts.map +0 -1
- package/dist/pptx/web-components/title-bar-styles.d.ts +0 -7
- package/dist/pptx/web-components/title-bar-styles.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createIconSvg, paintIcon, getIcon } from './chunk-BOX43CZD.js';
|
|
2
|
-
import { initialsOf } from './chunk-
|
|
3
|
-
import { OfficeElement, controlStyles, definer, valueOn, flag, present, triState, withTokens } from './chunk-
|
|
4
|
-
import { tok, OFFICE_TOKENS } from './chunk-
|
|
2
|
+
import { initialsOf } from './chunk-VUB44CAJ.js';
|
|
3
|
+
import { OfficeElement, controlStyles, definer, valueOn, flag, present, triState, withTokens } from './chunk-YK2DPYMU.js';
|
|
4
|
+
import { tok, OFFICE_TOKENS } from './chunk-XNCWB2X6.js';
|
|
5
5
|
import { html, LitElement, nothing, render, svg } from 'lit';
|
|
6
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
7
|
import { repeat } from 'lit/directives/repeat.js';
|
|
@@ -1009,6 +1009,299 @@ var OfficeUiFindBar = class extends OfficeElement {
|
|
|
1009
1009
|
};
|
|
1010
1010
|
var defineFindBar = definer("office-ui-find-bar", () => OfficeUiFindBar);
|
|
1011
1011
|
|
|
1012
|
+
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/comments/comments-pane.css?raw
|
|
1013
|
+
var comments_pane_default = ":host {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: var(--office-space-2);\n width: var(--office-comments-pane-width);\n padding: var(--office-space-2-5) var(--office-space-3);\n overflow-y: auto;\n border-inline-start: 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-line-height) var(--office-font);\n}\n:host([hidden]) {\n display: none;\n}\n:host([list-only]) {\n width: auto;\n padding: 0;\n border: 0;\n background: transparent;\n}\n.header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--office-space-2);\n}\nh2 {\n margin: 0;\n font-size: var(--office-font-size);\n font-weight: var(--office-font-weight-bold);\n}\n.composer,\n.reply,\n.edit {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--office-space-1);\n}\ntextarea {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--office-control-height-lg);\n resize: vertical;\n padding: var(--office-space-1) 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,\ntextarea:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.threads {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-2);\n}\n.thread {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-1-5);\n padding: var(--office-space-2);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius);\n background: var(--office-background);\n cursor: pointer;\n}\n.thread[aria-current='true'] {\n border-color: var(--office-accent);\n box-shadow: inset var(--office-border-width-thick) 0 0 var(--office-accent);\n}\n.thread[data-resolved='true'] {\n opacity: 0.65;\n}\n.anchor {\n display: flex;\n align-items: center;\n gap: var(--office-space-1-5);\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-xs);\n}\n.anchor-label {\n font-weight: var(--office-font-weight-medium);\n}\n.badge {\n padding: 0 var(--office-space-1);\n border-radius: var(--office-radius-full);\n background: var(--office-selected);\n}\n.comment {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-1);\n cursor: auto;\n}\n.comment.reply {\n margin-inline-start: var(--office-space-3);\n padding-inline-start: var(--office-space-2);\n border-inline-start: var(--office-border-width) solid var(--office-border);\n}\n.meta {\n display: flex;\n align-items: center;\n gap: var(--office-space-1-5);\n min-width: 0;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-xs);\n}\n.avatar {\n display: inline-grid;\n flex: none;\n place-items: center;\n width: var(--office-comment-avatar-size);\n height: var(--office-comment-avatar-size);\n border-radius: 50%;\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n font-size: var(--office-font-size-2xs);\n font-weight: var(--office-font-weight-bold);\n}\n.author {\n overflow: hidden;\n color: var(--office-foreground);\n font-weight: var(--office-font-weight-medium);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ntime {\n margin-inline-start: auto;\n white-space: nowrap;\n}\n.text {\n margin: 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n.actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-1);\n}\n.empty {\n margin: 0;\n color: var(--office-muted-foreground);\n}\n.thread:focus-visible,\ntextarea: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 (forced-colors: active) {\n .thread[aria-current='true'] {\n border-color: Highlight;\n }\n .avatar {\n border: var(--office-border-width) solid CanvasText;\n }\n}\n";
|
|
1014
|
+
|
|
1015
|
+
// src/comments/types.ts
|
|
1016
|
+
var DEFAULT_COMMENTS_LABELS = {
|
|
1017
|
+
heading: "Comments",
|
|
1018
|
+
list: "Comments",
|
|
1019
|
+
close: "Close comments",
|
|
1020
|
+
newComment: "New comment",
|
|
1021
|
+
add: "Add comment",
|
|
1022
|
+
reply: "Reply",
|
|
1023
|
+
resolve: "Resolve",
|
|
1024
|
+
reopen: "Reopen",
|
|
1025
|
+
resolved: "Resolved",
|
|
1026
|
+
edit: "Edit",
|
|
1027
|
+
save: "Save",
|
|
1028
|
+
cancel: "Cancel",
|
|
1029
|
+
delete: "Delete",
|
|
1030
|
+
edited: "Edited",
|
|
1031
|
+
empty: "No comments"
|
|
1032
|
+
};
|
|
1033
|
+
function commentInitials(author) {
|
|
1034
|
+
const words = author.trim().split(/\s+/).filter(Boolean);
|
|
1035
|
+
const letters = words.length > 1 ? [words[0], words.at(-1)] : words;
|
|
1036
|
+
return letters.map((word) => [...word][0] ?? "").join("").toLocaleUpperCase();
|
|
1037
|
+
}
|
|
1038
|
+
function formatCommentTime(created, locale) {
|
|
1039
|
+
if (!created) return "";
|
|
1040
|
+
if (!/^\d{4}-\d{2}-\d{2}/.test(created)) return created;
|
|
1041
|
+
const date = new Date(created);
|
|
1042
|
+
if (Number.isNaN(date.getTime())) return created;
|
|
1043
|
+
try {
|
|
1044
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short" }).format(
|
|
1045
|
+
date
|
|
1046
|
+
);
|
|
1047
|
+
} catch {
|
|
1048
|
+
return created;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
// src/comments/comments-pane.ts
|
|
1053
|
+
var INTERACTIVE = /* @__PURE__ */ new Set(["BUTTON", "TEXTAREA", "INPUT", "A", "SELECT"]);
|
|
1054
|
+
var OfficeUiCommentsPane = class extends OfficeElement {
|
|
1055
|
+
static styles = controlStyles(comments_pane_default);
|
|
1056
|
+
static properties = {
|
|
1057
|
+
threads: { attribute: false },
|
|
1058
|
+
activeThreadId: { attribute: "active-thread-id", type: String },
|
|
1059
|
+
readOnly: { attribute: "read-only", ...flag },
|
|
1060
|
+
listOnly: { attribute: "list-only", ...flag },
|
|
1061
|
+
closable: flag,
|
|
1062
|
+
addDisabled: { attribute: "add-disabled", ...flag },
|
|
1063
|
+
currentAuthor: { attribute: "current-author", type: String },
|
|
1064
|
+
labels: { attribute: false },
|
|
1065
|
+
classNames: { attribute: false },
|
|
1066
|
+
locale: { type: String }
|
|
1067
|
+
};
|
|
1068
|
+
focusedId;
|
|
1069
|
+
editingId;
|
|
1070
|
+
constructor() {
|
|
1071
|
+
super();
|
|
1072
|
+
this.threads = [];
|
|
1073
|
+
this.activeThreadId = null;
|
|
1074
|
+
this.readOnly = false;
|
|
1075
|
+
this.listOnly = false;
|
|
1076
|
+
this.closable = false;
|
|
1077
|
+
this.addDisabled = false;
|
|
1078
|
+
this.currentAuthor = null;
|
|
1079
|
+
this.labels = {};
|
|
1080
|
+
this.classNames = {};
|
|
1081
|
+
this.locale = null;
|
|
1082
|
+
}
|
|
1083
|
+
get text() {
|
|
1084
|
+
return { ...DEFAULT_COMMENTS_LABELS, ...this.labels };
|
|
1085
|
+
}
|
|
1086
|
+
get locked() {
|
|
1087
|
+
return present(this.readOnly);
|
|
1088
|
+
}
|
|
1089
|
+
/** The thread that takes Tab focus: the last one focused, else the active one, else the first. */
|
|
1090
|
+
get rovingId() {
|
|
1091
|
+
const ids = this.threads.map((thread) => thread.id);
|
|
1092
|
+
if (this.focusedId && ids.includes(this.focusedId)) return this.focusedId;
|
|
1093
|
+
if (this.activeThreadId && ids.includes(this.activeThreadId)) return this.activeThreadId;
|
|
1094
|
+
return ids[0];
|
|
1095
|
+
}
|
|
1096
|
+
card(id) {
|
|
1097
|
+
if (id === void 0) return null;
|
|
1098
|
+
return [...this.renderRoot.querySelectorAll(".thread")].find(
|
|
1099
|
+
(card) => card.dataset.threadId === id
|
|
1100
|
+
) ?? null;
|
|
1101
|
+
}
|
|
1102
|
+
/** Focus the current thread, or the new-comment box when there is none. */
|
|
1103
|
+
focus(options) {
|
|
1104
|
+
const target = this.card(this.rovingId) ?? this.renderRoot.querySelector("textarea");
|
|
1105
|
+
if (target) target.focus(options);
|
|
1106
|
+
else super.focus(options);
|
|
1107
|
+
}
|
|
1108
|
+
submitNew() {
|
|
1109
|
+
const box = this.renderRoot.querySelector("textarea.new");
|
|
1110
|
+
const text = box?.value.trim();
|
|
1111
|
+
if (!box || !text || this.locked || present(this.addDisabled)) return;
|
|
1112
|
+
box.value = "";
|
|
1113
|
+
this.fire("comment-add", { text });
|
|
1114
|
+
}
|
|
1115
|
+
submitReply(threadId) {
|
|
1116
|
+
const box = this.card(threadId)?.querySelector("textarea.reply-box");
|
|
1117
|
+
const text = box?.value.trim();
|
|
1118
|
+
if (!box || !text || this.locked) return;
|
|
1119
|
+
box.value = "";
|
|
1120
|
+
this.fire("comment-reply", { threadId, text });
|
|
1121
|
+
}
|
|
1122
|
+
startEdit(commentId) {
|
|
1123
|
+
this.editingId = commentId;
|
|
1124
|
+
this.requestUpdate();
|
|
1125
|
+
this.renderRoot.querySelector("textarea.edit-box")?.focus();
|
|
1126
|
+
}
|
|
1127
|
+
stopEdit() {
|
|
1128
|
+
this.editingId = void 0;
|
|
1129
|
+
this.requestUpdate();
|
|
1130
|
+
}
|
|
1131
|
+
saveEdit(thread, comment) {
|
|
1132
|
+
const box = this.renderRoot.querySelector("textarea.edit-box");
|
|
1133
|
+
const text = box?.value.trim();
|
|
1134
|
+
this.stopEdit();
|
|
1135
|
+
if (!text || text === comment.text || this.locked) return;
|
|
1136
|
+
this.fire("comment-edit", { threadId: thread.id, commentId: comment.id, text });
|
|
1137
|
+
}
|
|
1138
|
+
/** Ctrl+Enter (Cmd+Enter) posts from any box, like Office. */
|
|
1139
|
+
onBoxKey(event, submit) {
|
|
1140
|
+
if (event.key === "Enter" && (event.ctrlKey || event.metaKey) && !event.isComposing) {
|
|
1141
|
+
event.preventDefault();
|
|
1142
|
+
submit();
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
onEditKey(event, thread, comment) {
|
|
1146
|
+
if (event.key !== "Escape") return this.onBoxKey(event, () => this.saveEdit(thread, comment));
|
|
1147
|
+
event.preventDefault();
|
|
1148
|
+
event.stopPropagation();
|
|
1149
|
+
this.stopEdit();
|
|
1150
|
+
}
|
|
1151
|
+
select(threadId) {
|
|
1152
|
+
this.focusedId = threadId;
|
|
1153
|
+
this.requestUpdate();
|
|
1154
|
+
this.fire("thread-select", { threadId });
|
|
1155
|
+
}
|
|
1156
|
+
onThreadClick(event, threadId) {
|
|
1157
|
+
const inner = event.composedPath().some((node) => node instanceof HTMLElement && INTERACTIVE.has(node.tagName));
|
|
1158
|
+
if (!inner) this.select(threadId);
|
|
1159
|
+
}
|
|
1160
|
+
onListKey(event) {
|
|
1161
|
+
const card = event.composedPath()[0];
|
|
1162
|
+
if (!(card instanceof HTMLElement) || !card.classList.contains("thread")) return;
|
|
1163
|
+
const ids = this.threads.map((thread) => thread.id);
|
|
1164
|
+
const at = ids.indexOf(card.dataset.threadId ?? "");
|
|
1165
|
+
if (at < 0) return;
|
|
1166
|
+
const moves = {
|
|
1167
|
+
ArrowDown: Math.min(at + 1, ids.length - 1),
|
|
1168
|
+
ArrowUp: Math.max(at - 1, 0),
|
|
1169
|
+
Home: 0,
|
|
1170
|
+
End: ids.length - 1
|
|
1171
|
+
};
|
|
1172
|
+
const move = moves[event.key];
|
|
1173
|
+
if (move !== void 0) {
|
|
1174
|
+
event.preventDefault();
|
|
1175
|
+
this.focusedId = ids[move];
|
|
1176
|
+
this.requestUpdate();
|
|
1177
|
+
this.card(this.focusedId)?.focus();
|
|
1178
|
+
} else if (event.key === "Enter" || event.key === " ") {
|
|
1179
|
+
event.preventDefault();
|
|
1180
|
+
this.select(ids[at]);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
renderActions(thread, comment, first) {
|
|
1184
|
+
if (present(this.listOnly)) return nothing;
|
|
1185
|
+
const l = this.text;
|
|
1186
|
+
const locked = this.locked;
|
|
1187
|
+
const own = Boolean(this.currentAuthor) && comment.author === this.currentAuthor;
|
|
1188
|
+
const threadId = thread.id;
|
|
1189
|
+
const status = thread.resolved ? "reopen" : "resolve";
|
|
1190
|
+
return html`<div class="actions"
|
|
1191
|
+
>${first ? html`<button type="button" data-action=${status} ?disabled=${locked} @click=${() => thread.resolved ? this.fire("thread-reopen", { threadId }) : this.fire("thread-resolve", { threadId })}>${thread.resolved ? l.reopen : l.resolve}</button>` : nothing}${own && this.editingId !== comment.id ? html`<button type="button" data-action="edit" ?disabled=${locked} @click=${() => this.startEdit(comment.id)}>${l.edit}</button>` : nothing}<button
|
|
1192
|
+
type="button"
|
|
1193
|
+
data-action="delete"
|
|
1194
|
+
?disabled=${locked}
|
|
1195
|
+
@click=${() => this.fire("comment-delete", { threadId, commentId: comment.id })}
|
|
1196
|
+
>${l.delete}</button
|
|
1197
|
+
></div
|
|
1198
|
+
>`;
|
|
1199
|
+
}
|
|
1200
|
+
renderComment(thread, comment, first) {
|
|
1201
|
+
const l = this.text;
|
|
1202
|
+
const time = formatCommentTime(comment.created, this.locale ?? void 0);
|
|
1203
|
+
const body = this.editingId === comment.id && !this.locked ? html`<div class="edit">
|
|
1204
|
+
<textarea
|
|
1205
|
+
class="edit-box"
|
|
1206
|
+
aria-label=${l.edit}
|
|
1207
|
+
.value=${comment.text}
|
|
1208
|
+
@keydown=${(event) => this.onEditKey(event, thread, comment)}
|
|
1209
|
+
></textarea
|
|
1210
|
+
><div class="actions"
|
|
1211
|
+
><button
|
|
1212
|
+
type="button"
|
|
1213
|
+
data-action="save"
|
|
1214
|
+
@click=${() => this.saveEdit(thread, comment)}
|
|
1215
|
+
>${l.save}</button
|
|
1216
|
+
><button type="button" data-action="cancel" @click=${() => this.stopEdit()}
|
|
1217
|
+
>${l.cancel}</button
|
|
1218
|
+
></div
|
|
1219
|
+
></div
|
|
1220
|
+
>` : html`<p class="text">${comment.text}</p>`;
|
|
1221
|
+
return html`<div
|
|
1222
|
+
class="comment ${first ? "root" : "reply"} ${this.classNames.comment ?? ""}"
|
|
1223
|
+
data-comment-id=${comment.id}
|
|
1224
|
+
data-resolved=${String(thread.resolved)}
|
|
1225
|
+
><div class="meta"
|
|
1226
|
+
><span
|
|
1227
|
+
class="avatar"
|
|
1228
|
+
aria-hidden="true"
|
|
1229
|
+
style=${ifDefined(comment.color ? `background:${comment.color}` : void 0)}
|
|
1230
|
+
>${comment.initials || commentInitials(comment.author)}</span
|
|
1231
|
+
><span class="author">${comment.author}</span
|
|
1232
|
+
>${time ? html`<time datetime=${ifDefined(comment.created)}>${time}</time>` : nothing}${comment.edited ? html`<span class="edited">${l.edited}</span>` : nothing}</div
|
|
1233
|
+
>${body}${this.renderActions(thread, comment, first)}</div
|
|
1234
|
+
>`;
|
|
1235
|
+
}
|
|
1236
|
+
renderThread(thread, roving) {
|
|
1237
|
+
const l = this.text;
|
|
1238
|
+
const [first, ...replies] = thread.comments;
|
|
1239
|
+
const badge = thread.resolved && l.resolved;
|
|
1240
|
+
const anchor = thread.anchorLabel || badge ? html`<div class="anchor"
|
|
1241
|
+
>${thread.anchorLabel ? html`<span class="anchor-label">${thread.anchorLabel}</span>` : nothing}${badge ? html`<span class="badge">${l.resolved}</span>` : nothing}</div
|
|
1242
|
+
>` : nothing;
|
|
1243
|
+
const reply = present(this.listOnly) ? nothing : html`<div class="reply">
|
|
1244
|
+
<textarea
|
|
1245
|
+
class="reply-box"
|
|
1246
|
+
aria-label=${l.reply}
|
|
1247
|
+
placeholder=${l.reply}
|
|
1248
|
+
?disabled=${this.locked}
|
|
1249
|
+
@keydown=${(event) => this.onBoxKey(event, () => this.submitReply(thread.id))}
|
|
1250
|
+
></textarea
|
|
1251
|
+
><button
|
|
1252
|
+
type="button"
|
|
1253
|
+
data-action="reply"
|
|
1254
|
+
?disabled=${this.locked}
|
|
1255
|
+
@click=${() => this.submitReply(thread.id)}
|
|
1256
|
+
>${l.reply}</button
|
|
1257
|
+
></div
|
|
1258
|
+
>`;
|
|
1259
|
+
return html`<article
|
|
1260
|
+
role="listitem"
|
|
1261
|
+
class="thread ${this.classNames.thread ?? ""}"
|
|
1262
|
+
data-thread-id=${thread.id}
|
|
1263
|
+
data-resolved=${String(thread.resolved)}
|
|
1264
|
+
aria-current=${ifDefined(thread.id === this.activeThreadId ? "true" : void 0)}
|
|
1265
|
+
tabindex=${thread.id === roving ? "0" : "-1"}
|
|
1266
|
+
@click=${(event) => this.onThreadClick(event, thread.id)}
|
|
1267
|
+
>${anchor}${first ? this.renderComment(thread, first, true) : nothing}${replies.map((comment) => this.renderComment(thread, comment, false))}${reply}</article
|
|
1268
|
+
>`;
|
|
1269
|
+
}
|
|
1270
|
+
render() {
|
|
1271
|
+
const l = this.text;
|
|
1272
|
+
const closable = present(this.closable);
|
|
1273
|
+
const header = l.heading || closable ? html`<div class="header"
|
|
1274
|
+
>${l.heading ? html`<h2>${l.heading}</h2>` : nothing}${closable ? html`<button type="button" class="close" data-action="close" aria-label=${l.close} @click=${() => this.fire("comments-close", {})}>${l.close}</button>` : nothing}</div
|
|
1275
|
+
>` : nothing;
|
|
1276
|
+
const composer = present(this.listOnly) ? nothing : html`<div class="composer">
|
|
1277
|
+
<textarea
|
|
1278
|
+
class="new"
|
|
1279
|
+
aria-label=${l.newComment}
|
|
1280
|
+
placeholder=${l.newComment}
|
|
1281
|
+
?disabled=${this.locked}
|
|
1282
|
+
@keydown=${(event) => this.onBoxKey(event, () => this.submitNew())}
|
|
1283
|
+
></textarea
|
|
1284
|
+
><button
|
|
1285
|
+
type="button"
|
|
1286
|
+
data-action="add"
|
|
1287
|
+
?disabled=${this.locked || present(this.addDisabled)}
|
|
1288
|
+
@click=${() => this.submitNew()}
|
|
1289
|
+
>${l.add}</button
|
|
1290
|
+
></div
|
|
1291
|
+
>`;
|
|
1292
|
+
const roving = this.rovingId;
|
|
1293
|
+
const list = this.threads.length ? html`<div class="threads" role="list" aria-label=${l.list} @keydown=${this.onListKey}
|
|
1294
|
+
>${repeat(
|
|
1295
|
+
this.threads,
|
|
1296
|
+
(thread) => thread.id,
|
|
1297
|
+
(thread) => this.renderThread(thread, roving)
|
|
1298
|
+
)}</div
|
|
1299
|
+
>` : html`<p class="empty">${l.empty}</p>`;
|
|
1300
|
+
return html`${header}${composer}${list}`;
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
var defineCommentsPane = definer("office-ui-comments-pane", () => OfficeUiCommentsPane);
|
|
1304
|
+
|
|
1012
1305
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/chrome/print-preview.css?raw
|
|
1013
1306
|
var print_preview_default = ":host {\n display: block;\n max-width: var(--office-print-preview-width);\n font: var(--office-font-size-sm) var(--office-font);\n color: var(--office-foreground);\n}\n.sheet {\n padding: var(--office-space-3);\n border: var(--office-border-width) solid var(--office-border);\n background: var(--office-paper);\n box-shadow: var(--office-shadow-sm);\n}\n.sheet > * {\n display: block;\n width: 100%;\n height: auto;\n}\n.empty {\n color: var(--office-muted-foreground);\n}\n.nav {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--office-space-2);\n margin-top: var(--office-space-2);\n}\n.nav[hidden] {\n display: none;\n}\nbutton {\n min-width: var(--office-target-size);\n min-height: var(--office-target-size);\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 cursor: pointer;\n}\nbutton:disabled {\n opacity: 0.5;\n cursor: default;\n}\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(var(--office-focus-offset) / 2);\n}\n";
|
|
1014
1307
|
|
|
@@ -1100,7 +1393,7 @@ var OfficeUiPrintPreview = class extends OfficeElement {
|
|
|
1100
1393
|
var definePrintPreview = definer("office-ui-print-preview", () => OfficeUiPrintPreview);
|
|
1101
1394
|
|
|
1102
1395
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/ribbon/ribbon-tabs.css?raw
|
|
1103
|
-
var ribbon_tabs_default = ":host {\n display: block;\n min-width: 0;\n}\n.head {\n display: flex;\n align-items: stretch;\n min-width: 0;\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\n.file {\n flex: none;\n min-height: var(--office-ribbon-tab-height);\n margin: 0 var(--office-space-1) 0 0;\n padding: var(--office-space-1-5) var(--office-space-4);\n border: 0;\n border-radius: 0;\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n font: inherit;\n font-size: var(--office-font-size);\n cursor: pointer;\n}\n.file:hover {\n background: var(--office-accent-hover);\n}\n.file[hidden] {\n display: none;\n}\n[role='tablist'] {\n display: flex;\n flex: 0 1 auto;\n align-items: stretch;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: none;\n}\n[role='tab'] {\n position: relative;\n flex: none;\n min-height: var(--office-ribbon-tab-height);\n padding: var(--office-space-1-5) var(--office-space-3);\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--office-muted-foreground);\n font: inherit;\n font-size: var(--office-font-size);\n cursor: pointer;\n}\n[role='tab']:hover {\n color: var(--office-foreground);\n background: var(--office-surface);\n}\n[role='tab'][aria-selected='true'] {\n color: var(--office-accent);\n}\n[role='tab'][aria-selected='true']::after {\n content: '';\n position: absolute;\n inset: auto 0 0;\n height: var(--office-tab-indicator-width);\n background: var(--office-accent);\n}\n[role='tab'][data-contextual],\n[role='tab'][data-contextual][aria-selected='true'] {\n color: var(--office-ribbon-contextual);\n}\n[role='tab'][data-contextual][aria-selected='true']::after {\n background: var(--office-ribbon-contextual);\n}\n.file:focus-visible,\n[role='tab']:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(-1 * var(--office-focus-width));\n}\n::slotted([slot='search']) {\n align-self: center;\n}\n\n.collapse {\n flex: none;\n align-self: center;\n width: var(--office-target-size);\n height: var(--office-target-size);\n margin-inline:
|
|
1396
|
+
var ribbon_tabs_default = ":host {\n display: block;\n min-width: 0;\n}\n.head {\n display: flex;\n align-items: stretch;\n min-width: 0;\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\n.file {\n flex: none;\n min-height: var(--office-ribbon-tab-height);\n margin: 0 var(--office-space-1) 0 0;\n padding: var(--office-space-1-5) var(--office-space-4);\n border: 0;\n border-radius: 0;\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n font: inherit;\n font-size: var(--office-font-size);\n cursor: pointer;\n}\n.file:hover {\n background: var(--office-accent-hover);\n}\n.file[hidden] {\n display: none;\n}\n[role='tablist'] {\n display: flex;\n flex: 0 1 auto;\n align-items: stretch;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: none;\n}\n[role='tab'] {\n position: relative;\n flex: none;\n min-height: var(--office-ribbon-tab-height);\n padding: var(--office-space-1-5) var(--office-space-3);\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--office-muted-foreground);\n font: inherit;\n font-size: var(--office-font-size);\n cursor: pointer;\n}\n[role='tab']:hover {\n color: var(--office-foreground);\n background: var(--office-surface);\n}\n[role='tab'][aria-selected='true'] {\n color: var(--office-accent);\n}\n[role='tab'][aria-selected='true']::after {\n content: '';\n position: absolute;\n inset: auto 0 0;\n height: var(--office-tab-indicator-width);\n background: var(--office-accent);\n}\n[role='tab'][data-contextual],\n[role='tab'][data-contextual][aria-selected='true'] {\n color: var(--office-ribbon-contextual);\n}\n[role='tab'][data-contextual][aria-selected='true']::after {\n background: var(--office-ribbon-contextual);\n}\n.file:focus-visible,\n[role='tab']:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(-1 * var(--office-focus-width));\n}\n::slotted([slot='search']) {\n align-self: center;\n}\n/* The auto start margin keeps the actions, and the collapse button after them, at the right end of\n the tab row even while the slot is empty. */\nslot[name='actions'] {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--office-space-1);\n margin-inline: auto var(--office-space-1);\n}\n\n.collapse {\n flex: none;\n align-self: center;\n width: var(--office-target-size);\n height: var(--office-target-size);\n margin-inline: 0 var(--office-space-1);\n padding: 0;\n border: 0;\n border-radius: var(--office-radius-sm);\n background: none;\n color: var(--office-muted-foreground);\n cursor: pointer;\n}\n.collapse[hidden] {\n display: none;\n}\n.collapse:hover {\n background: var(--office-surface);\n}\n.collapse:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n}\n.collapse .glyph {\n width: var(--office-icon-size);\n height: var(--office-icon-size);\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n transform: rotate(90deg);\n}\n.collapse[aria-pressed='true'] .glyph {\n transform: rotate(-90deg);\n}\n:host([collapsed][peek]) {\n position: relative;\n}\n:host([collapsed][peek]) ::slotted([data-ribbon-tab]:not([hidden])) {\n position: absolute;\n inset: 100% 0 auto;\n z-index: 60;\n border-bottom: var(--office-border-width) solid var(--office-border);\n background: var(--office-background);\n box-shadow: var(--office-shadow);\n}\n\n@media (max-width: 760px), (pointer: coarse) {\n .file,\n [role='tab'] {\n min-height: var(--office-target-size-touch);\n }\n .file {\n min-width: var(--office-ribbon-file-min-width);\n }\n}\n@media (forced-colors: active) {\n .file {\n border: var(--office-border-width) solid ButtonText;\n }\n [role='tab'][aria-selected='true']::after {\n background: Highlight;\n }\n}\n";
|
|
1104
1397
|
|
|
1105
1398
|
// src/ribbon/ribbon-tabs.ts
|
|
1106
1399
|
var OfficeUiRibbon = class extends OfficeElement {
|
|
@@ -1322,6 +1615,7 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
1322
1615
|
</div>
|
|
1323
1616
|
<slot name="search"></slot>
|
|
1324
1617
|
<slot name="end"></slot>
|
|
1618
|
+
<slot name="actions" part="actions"></slot>
|
|
1325
1619
|
<button
|
|
1326
1620
|
class="collapse"
|
|
1327
1621
|
part="collapse"
|
|
@@ -1975,7 +2269,7 @@ var OfficeUiGallery = class extends OfficeElement {
|
|
|
1975
2269
|
var defineGallery = definer("office-ui-gallery", () => OfficeUiGallery);
|
|
1976
2270
|
|
|
1977
2271
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/chrome/ruler.css?raw
|
|
1978
|
-
var ruler_default = ":host {\n display: block;\n box-sizing: border-box;\n background: var(--office-background);\n color: var(--office-muted-foreground);\n overflow: hidden;\n font-size: var(--office-font-size-3xs);\n font-family: var(--office-font);\n}\n:host(:not([orientation='vertical'])) {\n height: var(--office-ruler-size);\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\n:host([orientation='vertical']) {\n width: var(--office-ruler-size);\n border-inline-end: var(--office-border-width) solid var(--office-border);\n}\ncanvas {\n display: block;\n width: 100%;\n height: 100%;\n}\n";
|
|
2272
|
+
var ruler_default = ":host {\n display: block;\n position: relative;\n box-sizing: border-box;\n background: var(--office-background);\n color: var(--office-muted-foreground);\n overflow: hidden;\n font-size: var(--office-font-size-3xs);\n font-family: var(--office-font);\n}\n:host(:not([orientation='vertical'])) {\n height: var(--office-ruler-size);\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\n:host([orientation='vertical']) {\n width: var(--office-ruler-size);\n border-inline-end: var(--office-border-width) solid var(--office-border);\n}\ncanvas {\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n}\n.margin {\n position: absolute;\n top: 0;\n bottom: 0;\n background: var(--office-selected);\n}\n:host([orientation='vertical']) .margin {\n top: auto;\n bottom: auto;\n left: 0;\n right: 0;\n}\n.marker {\n position: absolute;\n z-index: 1;\n width: 0;\n height: 0;\n margin-left: calc(var(--office-space-1) * -1);\n border-right: var(--office-space-1) solid transparent;\n border-left: var(--office-space-1) solid transparent;\n cursor: ew-resize;\n touch-action: none;\n pointer-events: auto;\n}\n.marker::after {\n content: '';\n position: absolute;\n inset: calc(var(--office-space-1-5) * -1);\n margin-left: calc(var(--office-space-1) * -1);\n}\n.marker.top {\n top: var(--office-space-px);\n border-top: var(--office-space-1-5) solid var(--office-accent);\n}\n.marker.bottom {\n bottom: var(--office-space-px);\n border-bottom: var(--office-space-1-5) solid var(--office-accent);\n}\n:host([orientation='vertical']) .marker {\n margin-top: calc(var(--office-space-1) * -1);\n margin-left: 0;\n border: 0;\n border-top: var(--office-space-1) solid transparent;\n border-bottom: var(--office-space-1) solid transparent;\n cursor: ns-resize;\n}\n:host([orientation='vertical']) .marker.top {\n top: auto;\n left: var(--office-space-px);\n border-left: var(--office-space-1-5) solid var(--office-accent);\n}\n:host([orientation='vertical']) .marker.bottom {\n right: var(--office-space-px);\n bottom: auto;\n border-right: var(--office-space-1-5) solid var(--office-accent);\n}\n";
|
|
1979
2273
|
|
|
1980
2274
|
// src/chrome/ruler.ts
|
|
1981
2275
|
function rulerDivisions(unitPixels) {
|
|
@@ -1987,9 +2281,17 @@ var OfficeUiRuler = class extends OfficeElement {
|
|
|
1987
2281
|
orientation: { type: String, reflect: true },
|
|
1988
2282
|
origin: { type: Number },
|
|
1989
2283
|
scale: { type: Number },
|
|
1990
|
-
direction: { type: String }
|
|
2284
|
+
direction: { type: String },
|
|
2285
|
+
extent: { type: Number },
|
|
2286
|
+
marginStart: { type: Number },
|
|
2287
|
+
marginEnd: { type: Number },
|
|
2288
|
+
zoom: { type: Number },
|
|
2289
|
+
labelsWithinMargins: { type: Boolean },
|
|
2290
|
+
label: { type: String },
|
|
2291
|
+
markers: { attribute: false }
|
|
1991
2292
|
};
|
|
1992
2293
|
frame = 0;
|
|
2294
|
+
zoomApplied = false;
|
|
1993
2295
|
observer;
|
|
1994
2296
|
constructor() {
|
|
1995
2297
|
super();
|
|
@@ -1997,6 +2299,13 @@ var OfficeUiRuler = class extends OfficeElement {
|
|
|
1997
2299
|
this.origin = 0;
|
|
1998
2300
|
this.scale = 96;
|
|
1999
2301
|
this.direction = "";
|
|
2302
|
+
this.extent = 0;
|
|
2303
|
+
this.marginStart = 0;
|
|
2304
|
+
this.marginEnd = 0;
|
|
2305
|
+
this.zoom = 1;
|
|
2306
|
+
this.labelsWithinMargins = false;
|
|
2307
|
+
this.label = "";
|
|
2308
|
+
this.markers = [];
|
|
2000
2309
|
}
|
|
2001
2310
|
connectedCallback() {
|
|
2002
2311
|
super.connectedCallback();
|
|
@@ -2018,11 +2327,61 @@ var OfficeUiRuler = class extends OfficeElement {
|
|
|
2018
2327
|
if (!this.frame) this.draw();
|
|
2019
2328
|
}
|
|
2020
2329
|
willUpdate() {
|
|
2021
|
-
this.
|
|
2330
|
+
if (this.label) {
|
|
2331
|
+
this.removeAttribute("aria-hidden");
|
|
2332
|
+
this.setAttribute("role", "img");
|
|
2333
|
+
this.setAttribute("aria-label", this.label);
|
|
2334
|
+
} else {
|
|
2335
|
+
this.setAttribute("aria-hidden", "true");
|
|
2336
|
+
if (this.getAttribute("role") === "img") this.removeAttribute("role");
|
|
2337
|
+
this.removeAttribute("aria-label");
|
|
2338
|
+
}
|
|
2022
2339
|
}
|
|
2023
2340
|
updated() {
|
|
2341
|
+
if (this.extent > 0)
|
|
2342
|
+
this.style.setProperty(
|
|
2343
|
+
this.orientation === "vertical" ? "height" : "width",
|
|
2344
|
+
`${this.extent}px`
|
|
2345
|
+
);
|
|
2346
|
+
if (this.zoom !== 1 && this.zoom > 0) {
|
|
2347
|
+
this.style.setProperty("zoom", String(this.zoom));
|
|
2348
|
+
this.zoomApplied = true;
|
|
2349
|
+
} else if (this.zoomApplied) {
|
|
2350
|
+
this.style.removeProperty("zoom");
|
|
2351
|
+
this.zoomApplied = false;
|
|
2352
|
+
}
|
|
2024
2353
|
this.schedule();
|
|
2025
2354
|
}
|
|
2355
|
+
get zoomFactor() {
|
|
2356
|
+
return this.zoom > 0 ? this.zoom : 1;
|
|
2357
|
+
}
|
|
2358
|
+
pointerPosition(event) {
|
|
2359
|
+
const box = this.getBoundingClientRect();
|
|
2360
|
+
const offset = this.orientation === "vertical" ? event.clientY - box.top : event.clientX - box.left;
|
|
2361
|
+
return offset / this.zoomFactor;
|
|
2362
|
+
}
|
|
2363
|
+
emit(type, detail) {
|
|
2364
|
+
this.dispatchEvent(new CustomEvent(type, { detail, bubbles: true, composed: true }));
|
|
2365
|
+
}
|
|
2366
|
+
dragMarker(event, name) {
|
|
2367
|
+
if (event.button !== 0) return;
|
|
2368
|
+
event.preventDefault();
|
|
2369
|
+
const marker = event.currentTarget;
|
|
2370
|
+
marker.setPointerCapture?.(event.pointerId);
|
|
2371
|
+
const move = (e) => this.emit("ruler-marker-move", { name, position: this.pointerPosition(e) });
|
|
2372
|
+
const finish = (e) => {
|
|
2373
|
+
marker.removeEventListener("pointermove", move);
|
|
2374
|
+
marker.removeEventListener("pointerup", finish);
|
|
2375
|
+
marker.removeEventListener("pointercancel", finish);
|
|
2376
|
+
this.emit(e.type === "pointerup" ? "ruler-marker-commit" : "ruler-marker-cancel", {
|
|
2377
|
+
name,
|
|
2378
|
+
position: this.pointerPosition(e)
|
|
2379
|
+
});
|
|
2380
|
+
};
|
|
2381
|
+
marker.addEventListener("pointermove", move);
|
|
2382
|
+
marker.addEventListener("pointerup", finish);
|
|
2383
|
+
marker.addEventListener("pointercancel", finish);
|
|
2384
|
+
}
|
|
2026
2385
|
draw() {
|
|
2027
2386
|
this.frame = 0;
|
|
2028
2387
|
const canvas = this.renderRoot.querySelector("canvas");
|
|
@@ -2031,9 +2390,9 @@ var OfficeUiRuler = class extends OfficeElement {
|
|
|
2031
2390
|
const vertical = this.orientation === "vertical";
|
|
2032
2391
|
const reverse = this.direction === "reverse";
|
|
2033
2392
|
const box = this.getBoundingClientRect();
|
|
2034
|
-
const length = vertical ? box.height : box.width;
|
|
2035
|
-
const thickness = (vertical ? box.width : box.height) || parseFloat(OFFICE_TOKENS["--office-ruler-size"]);
|
|
2036
|
-
const ratio = view?.devicePixelRatio ?? 1;
|
|
2393
|
+
const length = (vertical ? this.offsetHeight : this.offsetWidth) || (vertical ? box.height : box.width);
|
|
2394
|
+
const thickness = (vertical ? this.offsetWidth || box.width : this.offsetHeight || box.height) || parseFloat(OFFICE_TOKENS["--office-ruler-size"]);
|
|
2395
|
+
const ratio = (view?.devicePixelRatio ?? 1) * this.zoomFactor;
|
|
2037
2396
|
canvas.width = Math.max(1, Math.round((vertical ? thickness : length) * ratio));
|
|
2038
2397
|
canvas.height = Math.max(1, Math.round((vertical ? length : thickness) * ratio));
|
|
2039
2398
|
const context = canvas.getContext?.("2d");
|
|
@@ -2066,6 +2425,8 @@ var OfficeUiRuler = class extends OfficeElement {
|
|
|
2066
2425
|
context.lineTo(at, thickness - tick);
|
|
2067
2426
|
}
|
|
2068
2427
|
if (index % divisions !== 0) continue;
|
|
2428
|
+
if (this.labelsWithinMargins && (index < 0 || at < this.marginStart || at > length - this.marginEnd))
|
|
2429
|
+
continue;
|
|
2069
2430
|
const label = String(index / divisions);
|
|
2070
2431
|
if (!vertical) context.fillText(label, at + 2, 9);
|
|
2071
2432
|
else {
|
|
@@ -2079,7 +2440,22 @@ var OfficeUiRuler = class extends OfficeElement {
|
|
|
2079
2440
|
context.stroke();
|
|
2080
2441
|
}
|
|
2081
2442
|
render() {
|
|
2082
|
-
|
|
2443
|
+
const vertical = this.orientation === "vertical";
|
|
2444
|
+
const band = (side, size) => size > 0 ? html`<div
|
|
2445
|
+
class="margin"
|
|
2446
|
+
data-margin=${side}
|
|
2447
|
+
style="${side === "start" ? vertical ? "top" : "left" : vertical ? "bottom" : "right"}:0;${vertical ? "height" : "width"}:${size}px"
|
|
2448
|
+
></div>` : nothing;
|
|
2449
|
+
return html`${band("start", this.marginStart)}${band("end", this.marginEnd)}<canvas
|
|
2450
|
+
></canvas>${this.markers.map(
|
|
2451
|
+
(marker) => html`<div
|
|
2452
|
+
class="marker ${marker.edge === "top" ? "top" : "bottom"}"
|
|
2453
|
+
data-marker=${marker.name}
|
|
2454
|
+
style="${vertical ? "top" : "left"}:${marker.position}px"
|
|
2455
|
+
aria-label=${marker.label ?? nothing}
|
|
2456
|
+
@pointerdown=${(event) => this.dragMarker(event, marker.name)}
|
|
2457
|
+
></div>`
|
|
2458
|
+
)}`;
|
|
2083
2459
|
}
|
|
2084
2460
|
};
|
|
2085
2461
|
var defineRuler = definer("office-ui-ruler", () => OfficeUiRuler);
|
|
@@ -3867,7 +4243,7 @@ var OfficeUiSelect = class extends OfficeElement {
|
|
|
3867
4243
|
var defineSelect = definer("office-ui-select", () => OfficeUiSelect);
|
|
3868
4244
|
|
|
3869
4245
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/chrome/status-bar.css?raw
|
|
3870
|
-
var status_bar_default = ":host {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n min-height: var(--office-status-bar-height);\n padding: 0 var(--office-space-2);\n font-size: var(--office-font-size-xs);\n background: var(--office-surface);\n color: var(--office-foreground);\n border-top: var(--office-border-width) solid var(--office-border);\n font-family: var(--office-font);\n}\n::slotted([slot='end']) {\n margin-inline-start: auto;\n}\n.bar {\n display: contents;\n}\n[hidden] {\n display: none !important;\n}\n:host([data-controlled]) {\n display: block;\n flex: none;\n padding: 0;\n gap: 0;\n}\n:host([data-controlled]) .bar {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--office-space-1);\n width: 100%;\n min-height: var(--office-status-bar-height);\n padding: var(--office-space-0) var(--office-space-2);\n color: var(--office-muted-foreground);\n}\n:host([data-controlled]) ::slotted([slot='end']) {\n margin-inline-start: 0;\n}\n.items {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n.item {\n flex: none;\n white-space: nowrap;\n}\n.item + .item::before {\n content: '';\n display: inline-block;\n width: var(--office-border-width);\n height: var(--office-space-3);\n margin: 0 var(--office-space-2);\n vertical-align: middle;\n background: var(--office-border);\n}\n.item.saving {\n color: var(--office-warning);\n}\n.item.error {\n color: var(--office-danger);\n}\n.spacer {\n flex: 1;\n}\n.toggles,\n.group {\n display: flex;\n align-items: center;\n gap: var(--office-space-0);\n}\n.sep {\n flex: none;\n width: var(--office-border-width);\n height: var(--office-space-3);\n margin: 0 var(--office-space-0);\n background: var(--office-border);\n}\n.bar button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--office-space-1);\n min-width: var(--office-control-height-xs);\n min-height: var(--office-control-height-xs);\n padding: var(--office-space-1);\n border: 0;\n border-radius: var(--office-radius-sm);\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n touch-action: manipulation;\n}\n.bar button:hover {\n background: var(--office-selected);\n color: var(--office-foreground);\n}\n.bar button[aria-pressed='true'] {\n color: var(--office-accent);\n}\n.bar button:active {\n opacity: 0.8;\n}\n.bar button:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n.bar svg {\n flex: none;\n width: var(--office-icon-size);\n height: var(--office-icon-size);\n fill: none;\n stroke: currentColor;\n stroke-width: var(--office-icon-stroke);\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.toggle svg,\n.zoom-step svg {\n width: var(--office-icon-size-sm);\n height: var(--office-icon-size-sm);\n}\n.zoom-fit {\n min-width: var(--office-zoom-value-width);\n font-variant-numeric: tabular-nums;\n}\n@media (max-width: 767px) {\n .narrow-hide,\n .toggle .label {\n display: none !important;\n }\n}\n@media (pointer: coarse) {\n .bar button {\n min-width: var(--office-target-size-touch);\n min-height: var(--office-target-size-touch);\n }\n}\n@media (forced-colors: active) {\n :host {\n background: Canvas;\n color: CanvasText;\n border-top-color: CanvasText;\n }\n .bar button {\n color: ButtonText;\n }\n .bar button:hover {\n background: Highlight;\n color: HighlightText;\n }\n .bar button[aria-pressed='true'] {\n border: var(--office-border-width) solid Highlight;\n }\n .bar button:focus-visible {\n outline-color: Highlight;\n }\n .sep,\n .item + .item::before {\n background: CanvasText;\n }\n}\n";
|
|
4246
|
+
var status_bar_default = ":host {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n min-height: var(--office-status-bar-height);\n padding: 0 var(--office-space-2);\n font-size: var(--office-font-size-xs);\n background: var(--office-surface);\n color: var(--office-foreground);\n border-top: var(--office-border-width) solid var(--office-border);\n font-family: var(--office-font);\n}\n::slotted([slot='end']) {\n margin-inline-start: auto;\n}\n.bar {\n display: contents;\n}\n[hidden] {\n display: none !important;\n}\n:host([data-controlled]) {\n display: block;\n flex: none;\n padding: 0;\n gap: 0;\n}\n:host([data-controlled]) .bar {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--office-space-1);\n width: 100%;\n min-height: var(--office-status-bar-height);\n padding: var(--office-space-0) var(--office-space-2);\n color: var(--office-muted-foreground);\n}\n:host([data-controlled]) ::slotted([slot='end']) {\n margin-inline-start: 0;\n}\n.items {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n.item {\n flex: none;\n white-space: nowrap;\n}\n.item + .item::before {\n content: '';\n display: inline-block;\n width: var(--office-border-width);\n height: var(--office-space-3);\n margin: 0 var(--office-space-2);\n vertical-align: middle;\n background: var(--office-border);\n opacity: var(--office-status-bar-separator-opacity);\n}\n.item.saving {\n color: var(--office-warning);\n}\n.item.error {\n color: var(--office-danger);\n}\n.spacer {\n flex: 1;\n}\n.toggles,\n.group {\n display: flex;\n align-items: center;\n gap: var(--office-space-0);\n}\n.sep {\n flex: none;\n width: var(--office-border-width);\n height: var(--office-space-3);\n margin: 0 var(--office-space-0);\n background: var(--office-border);\n opacity: var(--office-status-bar-separator-opacity);\n}\n.bar button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--office-space-1);\n min-width: var(--office-control-height-xs);\n min-height: var(--office-control-height-xs);\n padding: var(--office-space-1);\n border: 0;\n border-radius: var(--office-radius-sm);\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n touch-action: manipulation;\n}\n.bar button:hover {\n background: var(--office-selected);\n color: var(--office-foreground);\n}\n.bar button[aria-pressed='true'] {\n color: var(--office-accent);\n}\n.bar button:active {\n opacity: 0.8;\n}\n.bar button:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n.bar svg {\n flex: none;\n width: var(--office-icon-size);\n height: var(--office-icon-size);\n fill: none;\n stroke: currentColor;\n stroke-width: var(--office-icon-stroke);\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.toggle svg,\n.zoom-step svg {\n width: var(--office-icon-size-sm);\n height: var(--office-icon-size-sm);\n}\n.zoom-fit {\n min-width: var(--office-zoom-value-width);\n font-variant-numeric: tabular-nums;\n}\n@media (max-width: 767px) {\n .narrow-hide,\n .toggle .label {\n display: none !important;\n }\n}\n@media (pointer: coarse) {\n .bar button {\n min-width: var(--office-target-size-touch);\n min-height: var(--office-target-size-touch);\n }\n}\n@media (forced-colors: active) {\n :host {\n background: Canvas;\n color: CanvasText;\n border-top-color: CanvasText;\n }\n .bar button {\n color: ButtonText;\n }\n .bar button:hover {\n background: Highlight;\n color: HighlightText;\n }\n .bar button[aria-pressed='true'] {\n border: var(--office-border-width) solid Highlight;\n }\n .bar button:focus-visible {\n outline-color: Highlight;\n }\n .sep,\n .item + .item::before {\n background: CanvasText;\n }\n}\n";
|
|
3871
4247
|
|
|
3872
4248
|
// src/chrome/status-bar.ts
|
|
3873
4249
|
var OfficeUiStatusBar = class extends OfficeElement {
|
|
@@ -3958,6 +4334,7 @@ var OfficeUiStatusBar = class extends OfficeElement {
|
|
|
3958
4334
|
</span>
|
|
3959
4335
|
<slot></slot>
|
|
3960
4336
|
<span class="spacer" ?hidden=${!state}></span>
|
|
4337
|
+
<slot name="summary"></slot>
|
|
3961
4338
|
<span class="toggles" ?hidden=${togglesHidden}>
|
|
3962
4339
|
${repeat(
|
|
3963
4340
|
toggles,
|
|
@@ -4186,7 +4563,7 @@ function matchTitleBarCommands(search, query) {
|
|
|
4186
4563
|
}
|
|
4187
4564
|
|
|
4188
4565
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/chrome/title-bar.css?raw
|
|
4189
|
-
var title_bar_default = ":host {\n display: block;\n flex: none;\n}\n:host([data-empty]) {\n display: none !important;\n}\n[hidden] {\n display: none !important;\n}\n.bar {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--office-space-1);\n width: 100%;\n height: var(--office-title-bar-height);\n padding: 0 var(--office-space-2);\n border-bottom: var(--office-border-width) solid var(--office-title-bar-border);\n background: var(--office-title-bar-background);\n color: var(--office-title-bar-foreground);\n font: var(--office-font-size-xs)/var(--office-line-height-tight) var(--office-font);\n user-select: none;\n}\n:host([placement='belowRibbon']) .bar {\n height: auto;\n min-height: var(--office-title-bar-below-height);\n padding-block: var(--office-space-0);\n}\n.mark {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--office-title-bar-mark-size);\n height: var(--office-title-bar-mark-size);\n border-radius: var(--office-radius-sm);\n background: var(--office-title-bar-mark-background);\n color: var(--office-title-bar-mark-foreground);\n font-size: var(--office-font-size-2xs);\n font-weight: var(--office-font-weight-bold);\n}\n.autosave {\n flex: none;\n display: flex;\n align-items: center;\n gap: var(--office-space-1-5);\n padding: 0 var(--office-space-0) 0 var(--office-space-1-5);\n white-space: nowrap;\n}\n.label,\n.dot,\n.status {\n color: var(--office-muted-foreground);\n white-space: nowrap;\n}\n.sep {\n flex: none;\n width: var(--office-border-width);\n height: var(--office-space-4);\n margin: 0 var(--office-space-1);\n background: var(--office-title-bar-border);\n}\n.qat {\n display: flex;\n align-items: center;\n gap: var(--office-space-0);\n min-width: 0;\n}\n.qat button,\n.results button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--office-space-1);\n min-width: var(--office-control-height-md);\n min-height: var(--office-control-height-md);\n padding: var(--office-space-1);\n border: 0;\n border-radius: var(--office-radius-sm);\n background: transparent;\n color: var(--office-muted-foreground);\n font: inherit;\n cursor: pointer;\n touch-action: manipulation;\n}\n.qat button:hover:not(:disabled) {\n background: var(--office-selected);\n}\n.qat button:active:not(:disabled) {\n opacity: 0.7;\n}\n.qat button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n.qat small {\n font-size: var(--office-font-size-xs);\n white-space: nowrap;\n}\nsvg {\n flex: none;\n width: var(--office-icon-size);\n height: var(--office-icon-size);\n fill: none;\n stroke: currentColor;\n stroke-width: var(--office-icon-stroke);\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.file {\n display: flex;\n align-items: baseline;\n gap: var(--office-space-1-5);\n min-width: 0;\n padding: 0 var(--office-space-1);\n flex: 0 1 auto;\n}\n.name {\n max-width: var(--office-title-bar-name-max-width);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--office-title-bar-foreground);\n font-size: var(--office-font-size-sm);\n font-weight: var(--office-font-weight-medium);\n}\n.status.saving {\n color: var(--office-warning);\n}\n.status.error {\n color: var(--office-danger);\n}\n.search {\n position: relative;\n flex: 1;\n display: flex;\n justify-content: center;\n min-width: 0;\n padding: 0 var(--office-space-2);\n}\n.box {\n position: relative;\n width: 100%;\n max-width: var(--office-title-bar-search-max-width);\n min-width: 0;\n}\n.box > [part='search'] {\n width: 100%;\n}\n.results {\n position: absolute;\n z-index: var(--office-z-popover);\n top: calc(100% + var(--office-space-1));\n right: 0;\n left: 0;\n max-height: var(--office-title-bar-results-max-height);\n overflow-y: auto;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-lg);\n background: var(--office-popover);\n color: var(--office-popover-foreground);\n box-shadow: var(--office-shadow-lg);\n}\n.heading {\n padding: var(--office-space-1-5) var(--office-space-3);\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-2xs);\n font-weight: var(--office-font-weight-bold);\n letter-spacing: 0.05em;\n text-transform: uppercase;\n}\n.empty {\n padding: var(--office-space-2) var(--office-space-3);\n color: var(--office-muted-foreground);\n}\n.results button {\n display: flex;\n width: 100%;\n justify-content: flex-start;\n gap: var(--office-space-2);\n padding: var(--office-space-1-5) var(--office-space-3);\n border-radius: 0;\n color: inherit;\n text-align: start;\n}\n.results button:hover,\n.results button[aria-selected='true'] {\n background: var(--office-selected);\n}\n.results .cat {\n margin-inline-start: auto;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-2xs);\n text-transform: capitalize;\n}\n.results .content {\n border-top: var(--office-border-width) solid var(--office-border);\n}\n.end {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--office-space-1);\n}\n.sr {\n position: absolute;\n width: var(--office-space-px);\n height: var(--office-space-px);\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n@media (max-width: 767px), (max-width: 1023px) and (max-height: 520px) {\n :host(:not([placement='belowRibbon'])) {\n display: none !important;\n }\n}\n@media (max-width: 1100px) {\n .qat small {\n display: none;\n }\n .name {\n max-width: var(--office-title-bar-name-max-width-narrow);\n }\n}\n@media (pointer: coarse) {\n .qat button,\n .results button {\n min-width: var(--office-target-size-touch);\n min-height: var(--office-target-size-touch);\n }\n .bar {\n height: auto;\n min-height: var(--office-target-size-touch);\n }\n}\n@media (forced-colors: active) {\n .bar {\n border-bottom-color: CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n .mark {\n border: var(--office-border-width) solid CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n .label,\n .dot,\n .status,\n .name,\n .qat button,\n .results button {\n color: CanvasText;\n }\n .sep {\n background: CanvasText;\n }\n .qat button:hover:not(:disabled),\n .results button:hover,\n .results button[aria-selected='true'] {\n background: Highlight;\n color: HighlightText;\n }\n .qat button:disabled {\n color: GrayText;\n opacity: 1;\n }\n .results {\n border-color: CanvasText;\n background: Canvas;\n }\n button:focus-visible {\n outline-color: Highlight;\n }\n}\n";
|
|
4566
|
+
var title_bar_default = ":host {\n display: block;\n flex: none;\n}\n:host([data-empty]) {\n display: none !important;\n}\n[hidden] {\n display: none !important;\n}\n.bar {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--office-space-1);\n width: 100%;\n height: var(--office-title-bar-height);\n padding: 0 var(--office-space-2);\n border-bottom: var(--office-border-width) solid var(--office-title-bar-border);\n background: var(--office-title-bar-background);\n color: var(--office-title-bar-foreground);\n font: var(--office-font-size-xs)/var(--office-line-height-tight) var(--office-font);\n user-select: none;\n}\n:host([placement='belowRibbon']) .bar {\n height: auto;\n min-height: var(--office-title-bar-below-height);\n padding-block: var(--office-space-0);\n}\n.mark {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--office-title-bar-mark-size);\n height: var(--office-title-bar-mark-size);\n border-radius: var(--office-radius-sm);\n background: var(--office-title-bar-mark-background);\n color: var(--office-title-bar-mark-foreground);\n font-size: var(--office-font-size-2xs);\n font-weight: var(--office-font-weight-bold);\n}\n.autosave {\n flex: none;\n display: flex;\n align-items: center;\n gap: var(--office-space-1-5);\n padding: 0 var(--office-space-0) 0 var(--office-space-1-5);\n white-space: nowrap;\n}\n.label,\n.dot,\n.status {\n color: var(--office-muted-foreground);\n white-space: nowrap;\n}\n.sep {\n flex: none;\n width: var(--office-border-width);\n height: var(--office-space-4);\n margin: 0 var(--office-space-1);\n background: var(--office-title-bar-border);\n}\n.qat {\n display: flex;\n align-items: center;\n gap: var(--office-space-0);\n min-width: 0;\n}\n.qat button,\n.results button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--office-space-1);\n min-width: var(--office-control-height-md);\n min-height: var(--office-control-height-md);\n padding: var(--office-space-1);\n border: 0;\n border-radius: var(--office-radius-sm);\n background: transparent;\n color: var(--office-muted-foreground);\n font: inherit;\n cursor: pointer;\n touch-action: manipulation;\n}\n.qat button:hover:not(:disabled) {\n background: var(--office-selected);\n}\n.qat button:active:not(:disabled) {\n opacity: 0.7;\n}\n.qat button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n.qat small {\n font-size: var(--office-font-size-xs);\n white-space: nowrap;\n}\nsvg {\n flex: none;\n width: var(--office-icon-size);\n height: var(--office-icon-size);\n fill: none;\n stroke: currentColor;\n stroke-width: var(--office-icon-stroke);\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.file {\n display: flex;\n align-items: baseline;\n gap: var(--office-space-1-5);\n min-width: 0;\n padding: 0 var(--office-space-1);\n flex: 0 1 auto;\n}\n.name {\n max-width: var(--office-title-bar-name-max-width);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--office-title-bar-name-foreground);\n font-size: var(--office-font-size-sm);\n font-weight: var(--office-font-weight-medium);\n}\n.status.saving {\n color: var(--office-warning);\n}\n.status.error {\n color: var(--office-danger);\n}\n.search {\n position: relative;\n flex: 1;\n display: flex;\n justify-content: center;\n min-width: 0;\n padding: 0 var(--office-space-2);\n}\n.box {\n position: relative;\n width: 100%;\n max-width: var(--office-title-bar-search-max-width);\n min-width: 0;\n}\n.box > [part='search'] {\n width: 100%;\n}\n.results {\n position: absolute;\n z-index: var(--office-z-popover);\n top: calc(100% + var(--office-space-1));\n right: 0;\n left: 0;\n max-height: var(--office-title-bar-results-max-height);\n overflow-y: auto;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-lg);\n background: var(--office-popover);\n color: var(--office-popover-foreground);\n box-shadow: var(--office-shadow-lg);\n}\n.heading {\n padding: var(--office-space-1-5) var(--office-space-3);\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-2xs);\n font-weight: var(--office-font-weight-bold);\n letter-spacing: 0.05em;\n text-transform: uppercase;\n}\n.empty {\n padding: var(--office-space-2) var(--office-space-3);\n color: var(--office-muted-foreground);\n}\n.results button {\n display: flex;\n width: 100%;\n justify-content: flex-start;\n gap: var(--office-space-2);\n padding: var(--office-space-1-5) var(--office-space-3);\n border-radius: 0;\n color: inherit;\n text-align: start;\n}\n.results button:hover,\n.results button[aria-selected='true'] {\n background: var(--office-title-bar-result-selected);\n}\n.results .cat {\n margin-inline-start: auto;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-2xs);\n text-transform: capitalize;\n}\n.results .content {\n border-top: var(--office-border-width) solid var(--office-border);\n}\n.end {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--office-space-1);\n}\n.sr {\n position: absolute;\n width: var(--office-space-px);\n height: var(--office-space-px);\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n@media (max-width: 767px), (max-width: 1023px) and (max-height: 520px) {\n :host(:not([placement='belowRibbon'])) {\n display: none !important;\n }\n}\n@media (max-width: 1100px) {\n .qat small {\n display: none;\n }\n .name {\n max-width: var(--office-title-bar-name-max-width-narrow);\n }\n}\n@media (pointer: coarse) {\n .qat button,\n .results button {\n min-width: var(--office-target-size-touch);\n min-height: var(--office-target-size-touch);\n }\n .bar {\n height: auto;\n min-height: var(--office-target-size-touch);\n }\n}\n@media (forced-colors: active) {\n .bar {\n border-bottom-color: CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n .mark {\n border: var(--office-border-width) solid CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n .label,\n .dot,\n .status,\n .name,\n .qat button,\n .results button {\n color: CanvasText;\n }\n .sep {\n background: CanvasText;\n }\n .qat button:hover:not(:disabled),\n .results button:hover,\n .results button[aria-selected='true'] {\n background: Highlight;\n color: HighlightText;\n }\n .qat button:disabled {\n color: GrayText;\n opacity: 1;\n }\n .results {\n border-color: CanvasText;\n background: Canvas;\n }\n button:focus-visible {\n outline-color: Highlight;\n }\n}\n";
|
|
4190
4567
|
|
|
4191
4568
|
// src/chrome/title-bar.ts
|
|
4192
4569
|
var EMPTY = { fileName: "" };
|
|
@@ -4985,10 +5362,11 @@ var CONTROL_DEFINERS = [
|
|
|
4985
5362
|
definePasteOptions,
|
|
4986
5363
|
defineTitleBar,
|
|
4987
5364
|
defineRibbonSection,
|
|
4988
|
-
defineGallery
|
|
5365
|
+
defineGallery,
|
|
5366
|
+
defineCommentsPane
|
|
4989
5367
|
];
|
|
4990
5368
|
function registerControls(registry) {
|
|
4991
5369
|
for (const define of CONTROL_DEFINERS) define(registry);
|
|
4992
5370
|
}
|
|
4993
5371
|
|
|
4994
|
-
export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_COLOR_SWATCHES, OFFICE_COLOR_SWATCH_HEXES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, assignKeyTips, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, glyph, nextEnabledIndex, parseSvgPreview, profileInitials, rangeControl, range_control_default, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile };
|
|
5372
|
+
export { CONTROL_DEFINERS, DEFAULT_COMMENTS_LABELS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_COLOR_SWATCHES, OFFICE_COLOR_SWATCH_HEXES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, assignKeyTips, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineCommentsPane, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, formatCommentTime, glyph, nextEnabledIndex, parseSvgPreview, profileInitials, rangeControl, range_control_default, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile };
|