@design.estate/dees-catalog 21.42.0 → 21.44.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/dist_bundle/bundle.js +541 -182
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-72W55DOJ.js → chunk-ETDITRNI.js} +4 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-72W55DOJ.js.map → chunk-ETDITRNI.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-PAFNUCDL.js → chunk-UD6S2QIF.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-GTAAYRP5.js → chunk-WZGJITN2.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-CQ56NZVB.js → de-NIKZVWN2.js} +4 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-NIKZVWN2.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-JNRW3HIY.js → dees-modal-BOGBX6EB.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-Y532Z546.js → dees-workspace-terminal-M3DB4LUI.js} +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-dataview/dees-thread/dees-thread.d.ts +20 -4
- package/dist_ts_web/elements/00group-dataview/dees-thread/dees-thread.demo.js +21 -4
- package/dist_ts_web/elements/00group-dataview/dees-thread/dees-thread.js +65 -10
- package/dist_ts_web/elements/00group-dataview/dees-thread/interfaces.d.ts +5 -0
- package/dist_ts_web/elements/00group-dataview/dees-thread/thread.markdown.d.ts +2 -1
- package/dist_ts_web/elements/00group-dataview/dees-thread/thread.markdown.js +6 -3
- package/dist_ts_web/elements/00group-harness/dees-harness-chat/dees-harness-chat.d.ts +2 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-chat/dees-harness-chat.js +2 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.d.ts +10 -2
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.js +26 -6
- package/dist_ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.d.ts +2 -0
- package/dist_ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.js +3 -2
- package/dist_ts_web/elements/00group-input/dees-input-reference/dees-input-reference.d.ts +1 -7
- package/dist_ts_web/elements/00group-input/dees-input-reference/dees-input-reference.js +22 -97
- package/dist_ts_web/elements/00group-input/dees-input-richtext/component.d.ts +23 -0
- package/dist_ts_web/elements/00group-input/dees-input-richtext/component.js +105 -5
- package/dist_ts_web/elements/00group-input/dees-input-richtext/demo.js +29 -1
- package/dist_ts_web/elements/00group-input/dees-input-richtext/index.d.ts +1 -1
- package/dist_ts_web/elements/00group-input/dees-input-richtext/index.js +5 -2
- package/dist_ts_web/elements/00group-input/dees-input-richtext/markdown.d.ts +21 -0
- package/dist_ts_web/elements/00group-input/dees-input-richtext/markdown.js +90 -6
- package/dist_ts_web/elements/00group-input/dees-input-richtext/references.d.ts +52 -0
- package/dist_ts_web/elements/00group-input/dees-input-richtext/references.js +152 -0
- package/dist_ts_web/elements/00group-input/dees-input-richtext/styles.js +23 -1
- package/dist_ts_web/elements/00group-input/dees-input-richtext/template.js +2 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +6 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.d.ts +15 -2
- package/dist_ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.js +44 -11
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.d.ts +7 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.js +67 -5
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +2 -2
- package/dist_ts_web/i18n/de.d.ts +6 -2
- package/dist_ts_web/i18n/de.js +3 -2
- package/dist_ts_web/i18n/messages.d.ts +6 -2
- package/dist_ts_web/i18n/messages.js +3 -2
- package/dist_ts_web/richtextmarkdown.d.ts +5 -1
- package/dist_ts_web/richtextmarkdown.js +6 -2
- package/package.json +1 -1
- package/readme.md +68 -12
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-dataview/dees-thread/dees-thread.demo.ts +23 -3
- package/ts_web/elements/00group-dataview/dees-thread/dees-thread.ts +50 -7
- package/ts_web/elements/00group-dataview/dees-thread/interfaces.ts +6 -0
- package/ts_web/elements/00group-dataview/dees-thread/thread.markdown.ts +5 -2
- package/ts_web/elements/00group-harness/dees-harness-chat/dees-harness-chat.ts +2 -1
- package/ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.ts +28 -5
- package/ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.ts +4 -2
- package/ts_web/elements/00group-input/dees-input-reference/dees-input-reference.ts +20 -88
- package/ts_web/elements/00group-input/dees-input-richtext/component.ts +83 -3
- package/ts_web/elements/00group-input/dees-input-richtext/demo.ts +34 -0
- package/ts_web/elements/00group-input/dees-input-richtext/index.ts +6 -0
- package/ts_web/elements/00group-input/dees-input-richtext/markdown.ts +93 -5
- package/ts_web/elements/00group-input/dees-input-richtext/references.ts +171 -0
- package/ts_web/elements/00group-input/dees-input-richtext/styles.ts +22 -0
- package/ts_web/elements/00group-input/dees-input-richtext/template.ts +1 -0
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +5 -0
- package/ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.ts +39 -10
- package/ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts +61 -3
- package/ts_web/elements/00group-kanban/kanban.demodata.ts +1 -1
- package/ts_web/i18n/de.ts +2 -1
- package/ts_web/i18n/messages.ts +2 -1
- package/ts_web/richtextmarkdown.ts +8 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-CQ56NZVB.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-PAFNUCDL.js.map → chunk-UD6S2QIF.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-GTAAYRP5.js.map → chunk-WZGJITN2.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-JNRW3HIY.js.map → dees-modal-BOGBX6EB.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-Y532Z546.js.map → dees-workspace-terminal-M3DB4LUI.js.map} +0 -0
package/dist_bundle/bundle.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
ownAppuiLabels,
|
|
27
27
|
resolveAppuiLabels,
|
|
28
28
|
xtermStyles
|
|
29
|
-
} from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-
|
|
29
|
+
} from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-UD6S2QIF.js";
|
|
30
30
|
import {
|
|
31
31
|
ActionRunController,
|
|
32
32
|
BarInfoController,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
workspaceVisibility,
|
|
125
125
|
zIndexLayers,
|
|
126
126
|
zIndexRegistry
|
|
127
|
-
} from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-
|
|
127
|
+
} from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-WZGJITN2.js";
|
|
128
128
|
import {
|
|
129
129
|
dcMessages,
|
|
130
130
|
dcSourceI18n,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
firstDayOfWeek,
|
|
135
135
|
iso_exports,
|
|
136
136
|
momentFormat
|
|
137
|
-
} from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-
|
|
137
|
+
} from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-ETDITRNI.js";
|
|
138
138
|
import {
|
|
139
139
|
__decorateElement,
|
|
140
140
|
__decoratorMetadata,
|
|
@@ -1876,7 +1876,8 @@ var _DeesInputMultitoggle = class _DeesInputMultitoggle extends (_a5 = DeesInput
|
|
|
1876
1876
|
const selected2 = key === this.selectedOption;
|
|
1877
1877
|
const icon = typeof option === "string" ? void 0 : option.icon;
|
|
1878
1878
|
const badge = typeof option === "string" ? void 0 : option.badge;
|
|
1879
|
-
|
|
1879
|
+
const description = typeof option === "string" ? void 0 : option.description;
|
|
1880
|
+
return b`<button type="button" role="radio" class="option ${selected2 ? "selected" : ""}" data-option=${label} .title=${description ?? ""}
|
|
1880
1881
|
aria-checked=${selected2} ?disabled=${this.optionDisabled(option)} tabindex=${key === (typeof focusKey === "object" ? focusKey.key : focusKey) ? 0 : -1}
|
|
1881
1882
|
@click=${() => this.handleSelection(key)} @keydown=${this.handleKeydown}><span class="option-content">${icon ? b`<dees-icon .icon=${icon} iconSize="14" aria-hidden="true"></dees-icon>` : ""}<span class="option-label">${label}</span>${badge !== void 0 ? b`<span class="option-badge">${badge}</span>` : ""}</span></button>`;
|
|
1882
1883
|
})}
|
|
@@ -40441,6 +40442,22 @@ var keptNote = [
|
|
|
40441
40442
|
"",
|
|
40442
40443
|
"Everything else is **editable** as usual."
|
|
40443
40444
|
].join("\n");
|
|
40445
|
+
var linkedNote = [
|
|
40446
|
+
"The transfer covers [#INV-2041 Hafenlogistik Bremen](#reference:inv-2041) and the second invoice.",
|
|
40447
|
+
"",
|
|
40448
|
+
"Type # to link another record."
|
|
40449
|
+
].join("\n");
|
|
40450
|
+
var records = [
|
|
40451
|
+
{ id: "inv-2041", label: "#INV-2041 Hafenlogistik Bremen" },
|
|
40452
|
+
{ id: "inv-2042", label: "#INV-2042 Hafenlogistik Bremen" },
|
|
40453
|
+
{ id: "ctr-17", label: "#CTR-17 Archive room lease" },
|
|
40454
|
+
{ id: "ctr-21", label: "#CTR-21 Telekom business line" }
|
|
40455
|
+
];
|
|
40456
|
+
var searchRecords = /* @__PURE__ */ __name(async (query2) => records.filter((record) => record.label.toLowerCase().includes(query2.toLowerCase())), "searchRecords");
|
|
40457
|
+
var showOpened = /* @__PURE__ */ __name((event) => {
|
|
40458
|
+
const { id, label } = event.detail;
|
|
40459
|
+
showDemoResult(event.currentTarget, `reference-open: ${id} (${label})`);
|
|
40460
|
+
}, "showOpened");
|
|
40444
40461
|
var noteToolbar = ["bold", "italic", "bulletList", "orderedList", "link", "undo", "redo"];
|
|
40445
40462
|
var showValue = /* @__PURE__ */ __name((event) => showDemoResult(event.currentTarget, event.detail.value), "showValue");
|
|
40446
40463
|
var demoFunc32 = /* @__PURE__ */ __name(() => focusedInputDemo("richtext", b`
|
|
@@ -40457,6 +40474,16 @@ var demoFunc32 = /* @__PURE__ */ __name(() => focusedInputDemo("richtext", b`
|
|
|
40457
40474
|
.toolbar=\${['bold', 'italic', 'bulletList', 'orderedList', 'link', 'undo', 'redo']}
|
|
40458
40475
|
.value=\${note.markdown}></dees-input-richtext>`)}
|
|
40459
40476
|
`)}
|
|
40477
|
+
${demoSection("Linking records", "With searchReferences the field links the host's records: # at the start of a word searches them at the caret, and the record chosen stands in the text as one piece, a link to #reference: and its id in the Markdown. Clicking it, or Enter on it, reports it as reference-open, for the host to open the record.", b`
|
|
40478
|
+
<dees-input-richtext label="Payment note" format="markdown" auto-grow .minHeight=${140} .showWordCount=${false}
|
|
40479
|
+
.toolbar=${noteToolbar} .value=${linkedNote} .searchReferences=${searchRecords} reference-search-label="Search records"
|
|
40480
|
+
@input=${showValue} @reference-open=${showOpened}></dees-input-richtext>
|
|
40481
|
+
${demoOutput(linkedNote)}
|
|
40482
|
+
${demoCode(`<dees-input-richtext label="Payment note" format="markdown"
|
|
40483
|
+
.searchReferences=\${(query, signal) => api.searchRecords(query, signal)}
|
|
40484
|
+
reference-search-label="Search records"
|
|
40485
|
+
@reference-open=\${(event) => openRecord(event.detail.id)}></dees-input-richtext>`)}
|
|
40486
|
+
`)}
|
|
40460
40487
|
${demoSection("Kept as written", "Markdown the editor does not offer \u2014 a table, an image, a footnote, a task list \u2014 is shown as written, read-only, and saved unchanged, wherever the rest of the note is edited.", b`
|
|
40461
40488
|
<dees-input-richtext label="Close notes" format="markdown" auto-grow .minHeight=${140} .showWordCount=${false}
|
|
40462
40489
|
.value=${keptNote} @input=${showValue}></dees-input-richtext>
|
|
@@ -40718,6 +40745,28 @@ var richtextStyles = [
|
|
|
40718
40745
|
color: color-mix(in srgb, var(--dees-color-link) 80%, var(--dees-color-text-primary));
|
|
40719
40746
|
}
|
|
40720
40747
|
|
|
40748
|
+
/* A reference to a record: read-only, reached and opened like a link. */
|
|
40749
|
+
.editor-content .ProseMirror [data-reference-id] {
|
|
40750
|
+
padding: 1px 5px;
|
|
40751
|
+
border-radius: var(--dees-radius-sm);
|
|
40752
|
+
color: var(--dees-color-link);
|
|
40753
|
+
background: var(--dees-color-fill-tertiary);
|
|
40754
|
+
font-weight: 500;
|
|
40755
|
+
cursor: pointer;
|
|
40756
|
+
}
|
|
40757
|
+
|
|
40758
|
+
.editor-content .ProseMirror [data-reference-id]:focus-visible,
|
|
40759
|
+
.editor-content .ProseMirror [data-reference-id].ProseMirror-selectednode {
|
|
40760
|
+
outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
|
|
40761
|
+
outline-offset: 1px;
|
|
40762
|
+
}
|
|
40763
|
+
|
|
40764
|
+
.reference-error {
|
|
40765
|
+
margin: 4px var(--richtext-inset-inline, 0px) 0;
|
|
40766
|
+
color: var(--dees-color-text-error);
|
|
40767
|
+
font-size: var(--dees-font-footnote-size);
|
|
40768
|
+
}
|
|
40769
|
+
|
|
40721
40770
|
/* Markdown the editor does not offer, kept as written: its source, read-only. */
|
|
40722
40771
|
.editor-content .ProseMirror .markdown-kept {
|
|
40723
40772
|
font-family: var(--dees-font-family-mono);
|
|
@@ -40865,6 +40914,7 @@ var renderRichtext = /* @__PURE__ */ __name((component) => {
|
|
|
40865
40914
|
</div>
|
|
40866
40915
|
` : ""}
|
|
40867
40916
|
</dees-tile>
|
|
40917
|
+
${component.referenceError ? b`<p class="reference-error" role="alert">${component.referenceError}</p>` : ""}
|
|
40868
40918
|
${component.renderDescription()}
|
|
40869
40919
|
</div>
|
|
40870
40920
|
`;
|
|
@@ -40879,6 +40929,17 @@ var richtextMarkdownRenderOptions = Object.freeze({
|
|
|
40879
40929
|
});
|
|
40880
40930
|
var keptBlockType = "markdownBlock";
|
|
40881
40931
|
var keptInlineType = "markdownInline";
|
|
40932
|
+
var referenceType = "catalogReference";
|
|
40933
|
+
var referencePrefix = "#reference:";
|
|
40934
|
+
var referenceHref = /* @__PURE__ */ __name((idArg) => `${referencePrefix}${encodeURIComponent(idArg)}`, "referenceHref");
|
|
40935
|
+
var referenceId = /* @__PURE__ */ __name((hrefArg) => {
|
|
40936
|
+
if (!hrefArg?.startsWith(referencePrefix)) return null;
|
|
40937
|
+
try {
|
|
40938
|
+
return decodeURIComponent(hrefArg.slice(referencePrefix.length)) || null;
|
|
40939
|
+
} catch {
|
|
40940
|
+
return null;
|
|
40941
|
+
}
|
|
40942
|
+
}, "referenceId");
|
|
40882
40943
|
var markdownToDoc = /* @__PURE__ */ __name((sourceArg) => {
|
|
40883
40944
|
const source = (sourceArg ?? "").replace(/\r\n?/g, "\n");
|
|
40884
40945
|
const reader = new MarkdownReader(source);
|
|
@@ -40887,6 +40948,39 @@ var markdownToDoc = /* @__PURE__ */ __name((sourceArg) => {
|
|
|
40887
40948
|
return { type: "doc", content: content.length ? content : [{ type: "paragraph" }] };
|
|
40888
40949
|
}, "markdownToDoc");
|
|
40889
40950
|
var docToMarkdown = /* @__PURE__ */ __name((docArg) => writeBlocks(docArg.content ?? []), "docToMarkdown");
|
|
40951
|
+
var markdownToReferences = /* @__PURE__ */ __name((sourceArg) => {
|
|
40952
|
+
const source = (sourceArg ?? "").replace(/\r\n?/g, "\n");
|
|
40953
|
+
const tree = iso_exports.parseMarkdown(source, { frontmatter: richtextMarkdownRenderOptions.frontmatter });
|
|
40954
|
+
const parts = [];
|
|
40955
|
+
let offset = 0;
|
|
40956
|
+
const visit = /* @__PURE__ */ __name((nodesArg) => {
|
|
40957
|
+
for (const node of nodesArg) {
|
|
40958
|
+
const reference = node.type === "link" ? referenceOf(node) : null;
|
|
40959
|
+
const { start: start2, end: end2 } = node.position ?? {};
|
|
40960
|
+
if (reference && start2?.offset !== void 0 && end2?.offset !== void 0) {
|
|
40961
|
+
if (start2.offset > offset) parts.push({ type: "text", text: source.slice(offset, start2.offset) });
|
|
40962
|
+
parts.push({ type: "reference", ...reference });
|
|
40963
|
+
offset = end2.offset;
|
|
40964
|
+
} else if (node.children) {
|
|
40965
|
+
visit(node.children);
|
|
40966
|
+
}
|
|
40967
|
+
}
|
|
40968
|
+
}, "visit");
|
|
40969
|
+
visit(tree.children);
|
|
40970
|
+
if (offset < source.length) parts.push({ type: "text", text: source.slice(offset) });
|
|
40971
|
+
return parts;
|
|
40972
|
+
}, "markdownToReferences");
|
|
40973
|
+
var referencesToMarkdown = /* @__PURE__ */ __name((contentArg) => contentArg.reduce(
|
|
40974
|
+
(markdown, part) => part.type === "text" ? markdown + part.text : beforeLink(markdown) + writeReference(part),
|
|
40975
|
+
""
|
|
40976
|
+
), "referencesToMarkdown");
|
|
40977
|
+
var referenceOf = /* @__PURE__ */ __name((nodeArg) => {
|
|
40978
|
+
const id = referenceId(nodeArg.url);
|
|
40979
|
+
const children = nodeArg.children ?? [];
|
|
40980
|
+
if (id === null || nodeArg.title || !children.length || !children.every((child) => child.type === "text")) return null;
|
|
40981
|
+
const label = children.map((child) => child.value ?? "").join("");
|
|
40982
|
+
return label && !label.includes("\n") ? { id, label } : null;
|
|
40983
|
+
}, "referenceOf");
|
|
40890
40984
|
var linesOf = /* @__PURE__ */ __name((textArg, marksArg) => textArg.split("\n").flatMap((line, index) => [
|
|
40891
40985
|
...index ? [{ type: "hardBreak" }] : [],
|
|
40892
40986
|
...line ? [withMarks({ type: "text", text: line }, marksArg)] : []
|
|
@@ -40973,11 +41067,14 @@ var MarkdownReader = class {
|
|
|
40973
41067
|
return this.inline(node.children ?? [], [...marksArg, { type: "bold" }]);
|
|
40974
41068
|
case "delete":
|
|
40975
41069
|
return this.inline(node.children ?? [], [...marksArg, { type: "strike" }]);
|
|
40976
|
-
case "link":
|
|
41070
|
+
case "link": {
|
|
41071
|
+
const reference = referenceOf(node);
|
|
41072
|
+
if (reference) return [withMarks({ type: referenceType, attrs: reference }, marksArg)];
|
|
40977
41073
|
return this.inline(node.children ?? [], [
|
|
40978
41074
|
...marksArg,
|
|
40979
41075
|
{ type: "link", attrs: { href: node.url ?? "", title: node.title ?? null } }
|
|
40980
41076
|
]);
|
|
41077
|
+
}
|
|
40981
41078
|
case "inlineCode":
|
|
40982
41079
|
return node.value ? [withMarks({ type: "text", text: node.value }, [...marksArg, { type: "code" }])] : [];
|
|
40983
41080
|
case "break":
|
|
@@ -41097,6 +41194,15 @@ var linkEnd = /* @__PURE__ */ __name((markArg) => {
|
|
|
41097
41194
|
const title = markArg.attrs?.title ? ` "${String(markArg.attrs.title).replace(/["\\]/g, "\\$&")}"` : "";
|
|
41098
41195
|
return `](${destination}${title})`;
|
|
41099
41196
|
}, "linkEnd");
|
|
41197
|
+
var beforeLink = /* @__PURE__ */ __name((writtenArg) => {
|
|
41198
|
+
const [, backslashes, bang] = /(\\*)(!?)$/.exec(writtenArg);
|
|
41199
|
+
if (bang) return backslashes.length % 2 ? writtenArg : `${writtenArg.slice(0, -1)}\\!`;
|
|
41200
|
+
return backslashes.length % 2 ? `${writtenArg}\\` : writtenArg;
|
|
41201
|
+
}, "beforeLink");
|
|
41202
|
+
var writeReference = /* @__PURE__ */ __name((referenceArg) => {
|
|
41203
|
+
const label = (referenceArg.label || referenceArg.id).replace(/[ \t]*\n[ \t]*/g, " ");
|
|
41204
|
+
return `[${escapeText(label, false)}${linkEnd({ type: "link", attrs: { href: referenceHref(referenceArg.id) } })}`;
|
|
41205
|
+
}, "writeReference");
|
|
41100
41206
|
var autolink = /* @__PURE__ */ __name((nodeArg, markArg) => {
|
|
41101
41207
|
const href = String(markArg.attrs?.href ?? "");
|
|
41102
41208
|
const text = nodeArg.text ?? "";
|
|
@@ -41138,7 +41244,7 @@ var escapeText = /* @__PURE__ */ __name((textArg, lineStartArg) => {
|
|
|
41138
41244
|
if (/^(#(?=[\s#]|$)|>|\||[-+=](?=[\s\-+=:|]|$)|:(?=-))/.test(escaped)) return `\\${escaped}`;
|
|
41139
41245
|
return escaped.replace(/^(\d{1,9})([.)])(?=\s|$)/, "$1\\$2");
|
|
41140
41246
|
}, "escapeText");
|
|
41141
|
-
var delimitedMarks = /* @__PURE__ */ __name((nodeArg) => (nodeArg?.marks ?? []).filter((mark) => mark.type in markRank), "delimitedMarks");
|
|
41247
|
+
var delimitedMarks = /* @__PURE__ */ __name((nodeArg) => (nodeArg?.marks ?? []).filter((mark) => mark.type in markRank && !(mark.type === "link" && nodeArg.type === referenceType)), "delimitedMarks");
|
|
41142
41248
|
var writeLine = /* @__PURE__ */ __name((nodesArg, escapeLineStartArg) => {
|
|
41143
41249
|
let out = "";
|
|
41144
41250
|
const open = [];
|
|
@@ -41167,7 +41273,7 @@ var writeLine = /* @__PURE__ */ __name((nodesArg, escapeLineStartArg) => {
|
|
|
41167
41273
|
pendingSpace += lead + trail;
|
|
41168
41274
|
continue;
|
|
41169
41275
|
}
|
|
41170
|
-
} else if (node.type !== keptInlineType) {
|
|
41276
|
+
} else if (node.type !== keptInlineType && node.type !== referenceType) {
|
|
41171
41277
|
continue;
|
|
41172
41278
|
}
|
|
41173
41279
|
let keep = 0;
|
|
@@ -41187,10 +41293,11 @@ var writeLine = /* @__PURE__ */ __name((nodesArg, escapeLineStartArg) => {
|
|
|
41187
41293
|
continue;
|
|
41188
41294
|
}
|
|
41189
41295
|
for (const mark of opening) {
|
|
41190
|
-
out
|
|
41296
|
+
out = mark.type === "link" ? `${beforeLink(out)}[` : out + delimiters[mark.type];
|
|
41191
41297
|
open.push(mark);
|
|
41192
41298
|
}
|
|
41193
41299
|
if (node.type === keptInlineType) out += String(node.attrs?.source ?? "");
|
|
41300
|
+
else if (node.type === referenceType) out = beforeLink(out) + writeReference({ id: String(node.attrs?.id ?? ""), label: String(node.attrs?.label ?? "") });
|
|
41194
41301
|
else out += code ? codeSpan(core) : escapeText(core, escapeLineStartArg && !out);
|
|
41195
41302
|
}
|
|
41196
41303
|
for (let closing = open.length - 1; closing >= 0; closing--) {
|
|
@@ -41267,8 +41374,139 @@ var markdownExtensions = /* @__PURE__ */ __name((bundleArg, keptLabelArg) => {
|
|
|
41267
41374
|
];
|
|
41268
41375
|
}, "markdownExtensions");
|
|
41269
41376
|
|
|
41377
|
+
// ts_web/elements/00group-input/dees-input-richtext/references.ts
|
|
41378
|
+
var referenceNode = /* @__PURE__ */ __name((bundleArg) => bundleArg.Node.create({
|
|
41379
|
+
name: referenceType,
|
|
41380
|
+
group: "inline",
|
|
41381
|
+
inline: true,
|
|
41382
|
+
atom: true,
|
|
41383
|
+
selectable: true,
|
|
41384
|
+
addAttributes: /* @__PURE__ */ __name(() => ({
|
|
41385
|
+
id: {
|
|
41386
|
+
default: "",
|
|
41387
|
+
parseHTML: /* @__PURE__ */ __name((element) => element.getAttribute("data-reference-id") ?? referenceId(element.getAttribute("href")) ?? "", "parseHTML")
|
|
41388
|
+
},
|
|
41389
|
+
label: { default: "", parseHTML: /* @__PURE__ */ __name((element) => element.textContent ?? "", "parseHTML") }
|
|
41390
|
+
}), "addAttributes"),
|
|
41391
|
+
parseHTML: /* @__PURE__ */ __name(() => [
|
|
41392
|
+
{ tag: "span[data-reference-id]" },
|
|
41393
|
+
// before Link's `a[href]`
|
|
41394
|
+
{
|
|
41395
|
+
tag: 'a[href^="#reference:"]',
|
|
41396
|
+
priority: 60,
|
|
41397
|
+
getAttrs: /* @__PURE__ */ __name((element) => typeof element !== "string" && referenceId(element.getAttribute("href")) !== null ? null : false, "getAttrs")
|
|
41398
|
+
}
|
|
41399
|
+
], "parseHTML"),
|
|
41400
|
+
renderHTML: /* @__PURE__ */ __name(({ node }) => ["span", { "data-reference-id": String(node.attrs.id) }, String(node.attrs.label)], "renderHTML"),
|
|
41401
|
+
renderText: /* @__PURE__ */ __name(({ node }) => String(node.attrs.label), "renderText"),
|
|
41402
|
+
// In the editor the reference is read-only and reached like a link; the HTML it writes stays plain.
|
|
41403
|
+
addNodeView: /* @__PURE__ */ __name(() => ({ node }) => {
|
|
41404
|
+
const dom = document.createElement("span");
|
|
41405
|
+
dom.dataset.referenceId = String(node.attrs.id);
|
|
41406
|
+
dom.contentEditable = "false";
|
|
41407
|
+
dom.setAttribute("role", "link");
|
|
41408
|
+
dom.tabIndex = 0;
|
|
41409
|
+
dom.textContent = String(node.attrs.label);
|
|
41410
|
+
return { dom };
|
|
41411
|
+
}, "addNodeView")
|
|
41412
|
+
}), "referenceNode");
|
|
41413
|
+
var referenceInsertMeta = "preventReferenceTrigger";
|
|
41414
|
+
var ReferencePicker = class {
|
|
41415
|
+
constructor(host) {
|
|
41416
|
+
this.host = host;
|
|
41417
|
+
}
|
|
41418
|
+
host;
|
|
41419
|
+
static {
|
|
41420
|
+
__name(this, "ReferencePicker");
|
|
41421
|
+
}
|
|
41422
|
+
popup;
|
|
41423
|
+
opening;
|
|
41424
|
+
range;
|
|
41425
|
+
get isOpen() {
|
|
41426
|
+
return !!this.popup;
|
|
41427
|
+
}
|
|
41428
|
+
/**
|
|
41429
|
+
* Opens the picker when the text right before the caret is the trigger. `wordStart` asks for the
|
|
41430
|
+
* trigger to start a word, outside code and links: `#` after a letter, as in `C#`, stays text.
|
|
41431
|
+
*/
|
|
41432
|
+
detect(triggerArg, optionsArg = {}) {
|
|
41433
|
+
const editor = this.host.editor();
|
|
41434
|
+
if (!editor || this.popup || this.host.disabled() || !this.host.search() || !triggerArg || editor.view.composing || !editor.isFocused) return;
|
|
41435
|
+
const { from, to, $from } = editor.state.selection;
|
|
41436
|
+
if (from !== to || $from.parentOffset < triggerArg.length) return;
|
|
41437
|
+
if ($from.parent.textBetween($from.parentOffset - triggerArg.length, $from.parentOffset, "", "\uFFFC") !== triggerArg) return;
|
|
41438
|
+
if (optionsArg.wordStart) {
|
|
41439
|
+
if ($from.parent.type.spec.code || $from.marks().some((mark) => mark.type.name === "code" || mark.type.name === "link")) return;
|
|
41440
|
+
const start2 = $from.parentOffset - triggerArg.length;
|
|
41441
|
+
const before = start2 ? $from.parent.textBetween(start2 - 1, start2, "", "\uFFFC") : "";
|
|
41442
|
+
if (before && !/[\s\p{Ps}\p{Pi}\ufffc]/u.test(before)) return;
|
|
41443
|
+
}
|
|
41444
|
+
this.range = { from: from - triggerArg.length, to };
|
|
41445
|
+
void this.open();
|
|
41446
|
+
}
|
|
41447
|
+
async close(restoreFocusArg) {
|
|
41448
|
+
const popup = this.popup;
|
|
41449
|
+
const editor = this.host.editor();
|
|
41450
|
+
const opening = this.opening;
|
|
41451
|
+
this.popup = void 0;
|
|
41452
|
+
this.range = void 0;
|
|
41453
|
+
if (!popup) return;
|
|
41454
|
+
await opening?.catch(() => void 0);
|
|
41455
|
+
await popup.hide();
|
|
41456
|
+
if (restoreFocusArg && this.host.element.isConnected && !this.host.disabled() && this.host.editor() === editor) editor?.commands.focus();
|
|
41457
|
+
}
|
|
41458
|
+
position() {
|
|
41459
|
+
const editor = this.host.editor();
|
|
41460
|
+
if (!editor || !this.popup || !this.range) return;
|
|
41461
|
+
const coords = editor.view.coordsAtPos(this.range.to);
|
|
41462
|
+
const { node } = editor.view.domAtPos(this.range.to);
|
|
41463
|
+
this.popup.triggerElement = node instanceof HTMLElement ? node : node.parentElement;
|
|
41464
|
+
this.popup.triggerRect = new DOMRect(coords.left, coords.top, 340, coords.bottom - coords.top);
|
|
41465
|
+
this.popup.opensToTop = window.innerHeight - coords.bottom < 300 && coords.top > window.innerHeight - coords.bottom;
|
|
41466
|
+
}
|
|
41467
|
+
async open() {
|
|
41468
|
+
const popup = this.popup = new DeesInputDropdownPopup();
|
|
41469
|
+
popup.ownerComponent = this.host.element;
|
|
41470
|
+
popup.searchLabel = this.host.searchLabel();
|
|
41471
|
+
provideOverlayI18n(popup, { i18n: this.host.i18n() });
|
|
41472
|
+
popup.searchOptions = async (query2, signal) => (await this.host.search()(query2, signal)).map((reference) => ({ key: reference.id, option: reference.label, payload: reference }));
|
|
41473
|
+
this.position();
|
|
41474
|
+
popup.addEventListener("reposition-request", () => this.position());
|
|
41475
|
+
popup.addEventListener("close-request", () => {
|
|
41476
|
+
void this.close(true);
|
|
41477
|
+
});
|
|
41478
|
+
popup.addEventListener("keydown", (event) => {
|
|
41479
|
+
if (event.key === "Tab") {
|
|
41480
|
+
event.preventDefault();
|
|
41481
|
+
void this.close(true);
|
|
41482
|
+
}
|
|
41483
|
+
});
|
|
41484
|
+
popup.addEventListener("option-selected", (event) => {
|
|
41485
|
+
const { id, label } = event.detail.payload;
|
|
41486
|
+
const range = this.range;
|
|
41487
|
+
const editor = this.host.editor();
|
|
41488
|
+
if (range && editor && !this.host.disabled()) {
|
|
41489
|
+
editor.chain().setMeta(referenceInsertMeta, true).insertContentAt(range, [
|
|
41490
|
+
{ type: referenceType, attrs: { id, label } },
|
|
41491
|
+
{ type: "text", text: " " }
|
|
41492
|
+
]).run();
|
|
41493
|
+
}
|
|
41494
|
+
void this.close(true);
|
|
41495
|
+
});
|
|
41496
|
+
this.opening = popup.show();
|
|
41497
|
+
try {
|
|
41498
|
+
await this.opening;
|
|
41499
|
+
this.host.opened();
|
|
41500
|
+
if (this.popup === popup && this.host.element.isConnected && !this.host.disabled()) await popup.focusSearchInput();
|
|
41501
|
+
} catch (error) {
|
|
41502
|
+
this.host.failed(error);
|
|
41503
|
+
void this.close(false);
|
|
41504
|
+
}
|
|
41505
|
+
}
|
|
41506
|
+
};
|
|
41507
|
+
|
|
41270
41508
|
// ts_web/elements/00group-input/dees-input-richtext/component.ts
|
|
41271
|
-
var _wordCount_dec2, _showLinkInput_dec, _frameless_dec12, _maxHeight_dec, _autoGrow_dec, _minHeight_dec, _showWordCount_dec, _toolbar_dec, _format_dec, _placeholder_dec5, _value_dec15, _a50, _DeesInputRichtext_decorators, _init52, _value15, _placeholder5, _format, _toolbar, _showWordCount, _minHeight, _autoGrow, _maxHeight, _frameless12, _showLinkInput, _wordCount2;
|
|
41509
|
+
var _wordCount_dec2, _showLinkInput_dec, _referenceError_dec, _referenceSearchLabel_dec, _referenceTrigger_dec, _searchReferences_dec, _frameless_dec12, _maxHeight_dec, _autoGrow_dec, _minHeight_dec, _showWordCount_dec, _toolbar_dec, _format_dec, _placeholder_dec5, _value_dec15, _a50, _DeesInputRichtext_decorators, _init52, _value15, _placeholder5, _format, _toolbar, _showWordCount, _minHeight, _autoGrow, _maxHeight, _frameless12, _searchReferences, _referenceTrigger, _referenceSearchLabel, _referenceError, _showLinkInput, _wordCount2;
|
|
41272
41510
|
var toolbarGlyphPx = 16;
|
|
41273
41511
|
var toolbarGroups = [
|
|
41274
41512
|
["bold", "italic", "underline", "strike"],
|
|
@@ -41304,7 +41542,7 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41304
41542
|
})], _frameless_dec12 = [n({
|
|
41305
41543
|
type: Boolean,
|
|
41306
41544
|
reflect: true
|
|
41307
|
-
})], _showLinkInput_dec = [r2()], _wordCount_dec2 = [r2()], _a50) {
|
|
41545
|
+
})], _searchReferences_dec = [n({ attribute: false })], _referenceTrigger_dec = [n({ type: String, attribute: "reference-trigger", reflect: true })], _referenceSearchLabel_dec = [n({ type: String, attribute: "reference-search-label", reflect: true })], _referenceError_dec = [r2()], _showLinkInput_dec = [r2()], _wordCount_dec2 = [r2()], _a50) {
|
|
41308
41546
|
constructor() {
|
|
41309
41547
|
super(...arguments);
|
|
41310
41548
|
/** The element's words and formats, in the reader's language; read by its template module too. */
|
|
@@ -41323,11 +41561,29 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41323
41561
|
__privateAdd(this, _autoGrow, __runInitializers(_init52, 32, this, false)), __runInitializers(_init52, 35, this);
|
|
41324
41562
|
__privateAdd(this, _maxHeight, __runInitializers(_init52, 36, this, 0)), __runInitializers(_init52, 39, this);
|
|
41325
41563
|
__privateAdd(this, _frameless12, __runInitializers(_init52, 40, this, false)), __runInitializers(_init52, 43, this);
|
|
41326
|
-
__privateAdd(this,
|
|
41327
|
-
__privateAdd(this,
|
|
41564
|
+
__privateAdd(this, _searchReferences, __runInitializers(_init52, 44, this)), __runInitializers(_init52, 47, this);
|
|
41565
|
+
__privateAdd(this, _referenceTrigger, __runInitializers(_init52, 48, this, "#")), __runInitializers(_init52, 51, this);
|
|
41566
|
+
__privateAdd(this, _referenceSearchLabel, __runInitializers(_init52, 52, this, "")), __runInitializers(_init52, 55, this);
|
|
41567
|
+
__privateAdd(this, _referenceError, __runInitializers(_init52, 56, this, "")), __runInitializers(_init52, 59, this);
|
|
41568
|
+
__privateAdd(this, _showLinkInput, __runInitializers(_init52, 60, this, false)), __runInitializers(_init52, 63, this);
|
|
41569
|
+
__privateAdd(this, _wordCount2, __runInitializers(_init52, 64, this, 0)), __runInitializers(_init52, 67, this);
|
|
41328
41570
|
__publicField(this, "editorElement");
|
|
41329
41571
|
__publicField(this, "linkInputElement");
|
|
41330
41572
|
__publicField(this, "tiptapBundle", null);
|
|
41573
|
+
__publicField(this, "picker", new ReferencePicker({
|
|
41574
|
+
element: this,
|
|
41575
|
+
editor: /* @__PURE__ */ __name(() => this.editor, "editor"),
|
|
41576
|
+
search: /* @__PURE__ */ __name(() => this.searchReferences, "search"),
|
|
41577
|
+
searchLabel: /* @__PURE__ */ __name(() => this.referenceSearchLabel || this.t("richtext.referenceSearch"), "searchLabel"),
|
|
41578
|
+
i18n: /* @__PURE__ */ __name(() => this.t.i18n, "i18n"),
|
|
41579
|
+
disabled: /* @__PURE__ */ __name(() => this.disabled, "disabled"),
|
|
41580
|
+
failed: /* @__PURE__ */ __name((error) => {
|
|
41581
|
+
this.referenceError = error instanceof Error ? error.message : this.t("reference.searchFailed");
|
|
41582
|
+
}, "failed"),
|
|
41583
|
+
opened: /* @__PURE__ */ __name(() => {
|
|
41584
|
+
this.referenceError = "";
|
|
41585
|
+
}, "opened")
|
|
41586
|
+
}));
|
|
41331
41587
|
__publicField(this, "editor");
|
|
41332
41588
|
}
|
|
41333
41589
|
render() {
|
|
@@ -41432,9 +41688,13 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41432
41688
|
}
|
|
41433
41689
|
updated(changed3) {
|
|
41434
41690
|
super.updated(changed3);
|
|
41435
|
-
if (changed3.has("disabled"))
|
|
41691
|
+
if (changed3.has("disabled")) {
|
|
41692
|
+
this.editor?.setEditable(!this.disabled, false);
|
|
41693
|
+
if (this.disabled) void this.picker.close(false);
|
|
41694
|
+
}
|
|
41436
41695
|
if (changed3.has("placeholder") || changed3.has("label")) this.nameEditable();
|
|
41437
41696
|
if (changed3.has("format") && changed3.get("format") !== void 0 && this.editor) {
|
|
41697
|
+
void this.picker.close(false);
|
|
41438
41698
|
this.editor.destroy();
|
|
41439
41699
|
this.editorElement.replaceChildren();
|
|
41440
41700
|
this.initializeEditor();
|
|
@@ -41442,6 +41702,7 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41442
41702
|
return;
|
|
41443
41703
|
}
|
|
41444
41704
|
if (changed3.has("value") && this.editor && this.value !== this.editorValue()) {
|
|
41705
|
+
void this.picker.close(false);
|
|
41445
41706
|
this.editor.commands.setContent(this.contentOf(this.value), false);
|
|
41446
41707
|
this.updateWordCount();
|
|
41447
41708
|
this.requestUpdate();
|
|
@@ -41488,14 +41749,37 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41488
41749
|
}
|
|
41489
41750
|
}),
|
|
41490
41751
|
...markdown ? [link, ...markdownExtensions(this.tiptapBundle, this.t("richtext.kept"))] : [Underline.configure({}), TextAlign.configure({ types: ["heading", "paragraph"] }), link],
|
|
41752
|
+
referenceNode(this.tiptapBundle),
|
|
41491
41753
|
Typography.configure({})
|
|
41492
41754
|
],
|
|
41493
41755
|
content: this.contentOf(this.value),
|
|
41494
|
-
|
|
41756
|
+
editorProps: {
|
|
41757
|
+
handleClickOn: /* @__PURE__ */ __name((_view3, _position5, node, _nodePosition, event, direct) => {
|
|
41758
|
+
if (!direct || node.type.name !== referenceType) return false;
|
|
41759
|
+
event.preventDefault();
|
|
41760
|
+
this.openReference({ id: String(node.attrs.id), label: String(node.attrs.label) });
|
|
41761
|
+
return true;
|
|
41762
|
+
}, "handleClickOn"),
|
|
41763
|
+
handleDOMEvents: {
|
|
41764
|
+
keydown: /* @__PURE__ */ __name((_view3, event) => {
|
|
41765
|
+
const target = event.target;
|
|
41766
|
+
if (event.key !== "Enter" || !target.dataset?.referenceId) return false;
|
|
41767
|
+
event.preventDefault();
|
|
41768
|
+
this.openReference({ id: target.dataset.referenceId, label: target.textContent ?? "" });
|
|
41769
|
+
return true;
|
|
41770
|
+
}, "keydown"),
|
|
41771
|
+
compositionend: /* @__PURE__ */ __name(() => {
|
|
41772
|
+
queueMicrotask(() => this.detectReference());
|
|
41773
|
+
return false;
|
|
41774
|
+
}, "compositionend")
|
|
41775
|
+
}
|
|
41776
|
+
},
|
|
41777
|
+
onUpdate: /* @__PURE__ */ __name(({ transaction }) => {
|
|
41495
41778
|
this.value = this.editorValue();
|
|
41496
41779
|
this.updateWordCount();
|
|
41497
41780
|
this.changeSubject.next(this.value);
|
|
41498
41781
|
this.reportValueEdit();
|
|
41782
|
+
if (!transaction.getMeta(referenceInsertMeta)) this.detectReference();
|
|
41499
41783
|
}, "onUpdate"),
|
|
41500
41784
|
onSelectionUpdate: /* @__PURE__ */ __name(() => {
|
|
41501
41785
|
this.requestUpdate();
|
|
@@ -41510,6 +41794,12 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41510
41794
|
this.updateWordCount();
|
|
41511
41795
|
this.nameEditable();
|
|
41512
41796
|
}
|
|
41797
|
+
detectReference() {
|
|
41798
|
+
this.picker.detect(this.referenceTrigger, { wordStart: true });
|
|
41799
|
+
}
|
|
41800
|
+
openReference(referenceArg) {
|
|
41801
|
+
this.dispatchEvent(new CustomEvent("reference-open", { detail: referenceArg, bubbles: true, composed: true }));
|
|
41802
|
+
}
|
|
41513
41803
|
updateWordCount() {
|
|
41514
41804
|
if (!this.editor) return;
|
|
41515
41805
|
const text = this.editor.getText();
|
|
@@ -41580,6 +41870,7 @@ var _DeesInputRichtext = class _DeesInputRichtext extends (_a50 = DeesInputBase,
|
|
|
41580
41870
|
this.editor?.commands.focus();
|
|
41581
41871
|
}
|
|
41582
41872
|
async disconnectedCallback() {
|
|
41873
|
+
void this.picker.close(false);
|
|
41583
41874
|
await super.disconnectedCallback();
|
|
41584
41875
|
if (this.editor) {
|
|
41585
41876
|
this.editor.destroy();
|
|
@@ -41596,6 +41887,10 @@ _minHeight = new WeakMap();
|
|
|
41596
41887
|
_autoGrow = new WeakMap();
|
|
41597
41888
|
_maxHeight = new WeakMap();
|
|
41598
41889
|
_frameless12 = new WeakMap();
|
|
41890
|
+
_searchReferences = new WeakMap();
|
|
41891
|
+
_referenceTrigger = new WeakMap();
|
|
41892
|
+
_referenceSearchLabel = new WeakMap();
|
|
41893
|
+
_referenceError = new WeakMap();
|
|
41599
41894
|
_showLinkInput = new WeakMap();
|
|
41600
41895
|
_wordCount2 = new WeakMap();
|
|
41601
41896
|
__decorateElement(_init52, 4, "value", _value_dec15, _DeesInputRichtext, _value15);
|
|
@@ -41607,6 +41902,10 @@ __decorateElement(_init52, 4, "minHeight", _minHeight_dec, _DeesInputRichtext, _
|
|
|
41607
41902
|
__decorateElement(_init52, 4, "autoGrow", _autoGrow_dec, _DeesInputRichtext, _autoGrow);
|
|
41608
41903
|
__decorateElement(_init52, 4, "maxHeight", _maxHeight_dec, _DeesInputRichtext, _maxHeight);
|
|
41609
41904
|
__decorateElement(_init52, 4, "frameless", _frameless_dec12, _DeesInputRichtext, _frameless12);
|
|
41905
|
+
__decorateElement(_init52, 4, "searchReferences", _searchReferences_dec, _DeesInputRichtext, _searchReferences);
|
|
41906
|
+
__decorateElement(_init52, 4, "referenceTrigger", _referenceTrigger_dec, _DeesInputRichtext, _referenceTrigger);
|
|
41907
|
+
__decorateElement(_init52, 4, "referenceSearchLabel", _referenceSearchLabel_dec, _DeesInputRichtext, _referenceSearchLabel);
|
|
41908
|
+
__decorateElement(_init52, 4, "referenceError", _referenceError_dec, _DeesInputRichtext, _referenceError);
|
|
41610
41909
|
__decorateElement(_init52, 4, "showLinkInput", _showLinkInput_dec, _DeesInputRichtext, _showLinkInput);
|
|
41611
41910
|
__decorateElement(_init52, 4, "wordCount", _wordCount_dec2, _DeesInputRichtext, _wordCount2);
|
|
41612
41911
|
_DeesInputRichtext = __decorateElement(_init52, 0, "DeesInputRichtext", _DeesInputRichtext_decorators, _DeesInputRichtext);
|
|
@@ -53663,6 +53962,8 @@ var demoFunc46 = /* @__PURE__ */ __name(() => demoPage("Composer", "Write, attac
|
|
|
53663
53962
|
var _actionMenuOpen_dec, _actionMenu_dec, _menuActions_dec, _showModelControls_dec, _modeOptions_dec, _mode_dec, _effortOptions_dec, _reasoningEffort_dec, _modelOptions_dec, _model_dec, _accountNote_dec, _accountOptions_dec, _account_dec, _attachmentAccept_dec, _maxAttachmentCount_dec, _maxTotalAttachmentBytes_dec, _maxAttachmentBytes_dec, _promptFocused_dec, _commandMenuDismissed_dec, _activeMenuIndex_dec, _commands_dec, _attachmentsEnabled_dec, _attachments_dec, _queuedCount_dec, _abortDisabledReason_dec, _abortEnabled_dec, _busyDeliveryModes_dec, _busy_dec3, _inputLocked_dec, _disabled_dec3, _docked_dec, _contextDescription_dec, _placeholder_dec6, _pendingMessageId_dec, _pendingMessagePresent_dec, _historyKey_dec, _loadEarlierHistory_dec, _hasEarlierHistory_dec, _history_dec, _value_dec16, _a67, _DeesHarnessComposer_decorators, _init69, _value16, _history, _hasEarlierHistory, _loadEarlierHistory, _historyKey, _pendingMessagePresent, _pendingMessageId, _placeholder6, _contextDescription, _docked, _disabled3, _inputLocked, _busy3, _busyDeliveryModes, _abortEnabled, _abortDisabledReason, _queuedCount, _attachments, _attachmentsEnabled, _commands, _activeMenuIndex, _commandMenuDismissed, _promptFocused, _maxAttachmentBytes, _maxTotalAttachmentBytes, _maxAttachmentCount, _attachmentAccept, _account, _accountOptions, _accountNote, _model, _modelOptions, _reasoningEffort, _effortOptions, _mode, _modeOptions, _showModelControls, _menuActions, _actionMenu, _actionMenuOpen;
|
|
53664
53963
|
var toDropdownOptions = /* @__PURE__ */ __name((values) => values.map((value) => ({ option: value, key: value })), "toDropdownOptions");
|
|
53665
53964
|
var toLabeledDropdownOptions = /* @__PURE__ */ __name((values) => values.map((value) => ({ option: value.label, key: value.value, disabled: value.disabled, description: value.description })), "toLabeledDropdownOptions");
|
|
53965
|
+
var modeOptionValue = /* @__PURE__ */ __name((option) => typeof option === "string" ? option : option.value, "modeOptionValue");
|
|
53966
|
+
var toModeToggleOptions = /* @__PURE__ */ __name((values) => values.map((value) => typeof value === "string" ? value : { key: value.value, label: value.label, disabled: value.disabled, description: value.description }), "toModeToggleOptions");
|
|
53666
53967
|
var nextCommandMenuId = 0;
|
|
53667
53968
|
var commandNameInput = /^\/([^\s/\\]*)$/u;
|
|
53668
53969
|
var commandArgumentInput = /^\/([^\s/\\]+)[ \t]+([^\n]*)$/u;
|
|
@@ -53760,6 +54061,8 @@ var _DeesHarnessComposer = class _DeesHarnessComposer extends (_a67 = DeesElemen
|
|
|
53760
54061
|
__privateAdd(this, _effortOptions, __runInitializers(_init69, 140, this, [])), __runInitializers(_init69, 143, this);
|
|
53761
54062
|
__privateAdd(this, _mode, __runInitializers(_init69, 144, this, "")), __runInitializers(_init69, 147, this);
|
|
53762
54063
|
__privateAdd(this, _modeOptions, __runInitializers(_init69, 148, this, [])), __runInitializers(_init69, 151, this);
|
|
54064
|
+
/** The switch's options, rebuilt only with `modeOptions`, so typing never redraws the switch. */
|
|
54065
|
+
__publicField(this, "modeToggleOptions", []);
|
|
53763
54066
|
__privateAdd(this, _showModelControls, __runInitializers(_init69, 152, this, true)), __runInitializers(_init69, 155, this);
|
|
53764
54067
|
__privateAdd(this, _menuActions, __runInitializers(_init69, 156, this, [])), __runInitializers(_init69, 159, this);
|
|
53765
54068
|
__privateAdd(this, _actionMenu, __runInitializers(_init69, 160, this)), __runInitializers(_init69, 163, this);
|
|
@@ -53814,8 +54117,10 @@ var _DeesHarnessComposer = class _DeesHarnessComposer extends (_a67 = DeesElemen
|
|
|
53814
54117
|
if (this.handlePromptHistoryKey(event)) return;
|
|
53815
54118
|
if (event.key === "Tab" && event.shiftKey && this.modeOptions.length) {
|
|
53816
54119
|
event.preventDefault();
|
|
53817
|
-
const
|
|
53818
|
-
|
|
54120
|
+
const modes = this.modeOptions.filter((option) => typeof option === "string" || !option.disabled).map(modeOptionValue);
|
|
54121
|
+
if (!modes.length) return;
|
|
54122
|
+
const nextMode = modes[(modes.indexOf(this.mode) + 1) % modes.length];
|
|
54123
|
+
if (nextMode === this.mode) return;
|
|
53819
54124
|
this.mode = nextMode;
|
|
53820
54125
|
this.emit("harness-mode-change", { mode: nextMode });
|
|
53821
54126
|
}
|
|
@@ -53913,6 +54218,7 @@ var _DeesHarnessComposer = class _DeesHarnessComposer extends (_a67 = DeesElemen
|
|
|
53913
54218
|
super.willUpdate(changedProperties);
|
|
53914
54219
|
if (changedProperties.has("value") || changedProperties.has("commands")) this.activeMenuIndex = -1;
|
|
53915
54220
|
if (changedProperties.has("historyKey")) this.resetHistoryNavigation();
|
|
54221
|
+
if (changedProperties.has("modeOptions")) this.modeToggleOptions = toModeToggleOptions(this.modeOptions);
|
|
53916
54222
|
}
|
|
53917
54223
|
updated(changedProperties) {
|
|
53918
54224
|
super.updated(changedProperties);
|
|
@@ -53988,7 +54294,7 @@ var _DeesHarnessComposer = class _DeesHarnessComposer extends (_a67 = DeesElemen
|
|
|
53988
54294
|
</dees-button>` : ""}
|
|
53989
54295
|
${this.modeOptions.length ? b`
|
|
53990
54296
|
<dees-input-multitoggle class="modeSwitch" label=${this.t("composer.mode")} .labelPosition=${"none"}
|
|
53991
|
-
.options=${this.
|
|
54297
|
+
.options=${this.modeToggleOptions} .selectedOption=${this.mode} .disabled=${this.interactionLocked}
|
|
53992
54298
|
@input=${(event) => event.stopPropagation()}
|
|
53993
54299
|
@change=${(event) => {
|
|
53994
54300
|
event.stopPropagation();
|
|
@@ -69907,14 +70213,14 @@ var demoFunc65 = /* @__PURE__ */ __name(() => demoPage(
|
|
|
69907
70213
|
), "demoFunc");
|
|
69908
70214
|
|
|
69909
70215
|
// ts_web/elements/00group-input/dees-input-reference/dees-input-reference.ts
|
|
69910
|
-
var _loadError_dec3, _disabled_dec6, _documentKey_dec, _searchLabel_dec2, _placeholder_dec7, _label_dec8, _trigger_dec,
|
|
70216
|
+
var _loadError_dec3, _disabled_dec6, _documentKey_dec, _searchLabel_dec2, _placeholder_dec7, _label_dec8, _trigger_dec, _searchReferences_dec2, _value_dec17, _a94, _DeesInputReference_decorators, _init95, _value17, _searchReferences2, _trigger, _label8, _placeholder7, _searchLabel2, _documentKey, _disabled6, _loadError3;
|
|
69911
70217
|
_DeesInputReference_decorators = [customElement("dees-input-reference")];
|
|
69912
|
-
var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement, _value_dec17 = [n({ attribute: false })],
|
|
70218
|
+
var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement, _value_dec17 = [n({ attribute: false })], _searchReferences_dec2 = [n({ attribute: false })], _trigger_dec = [n({ type: String, reflect: true })], _label_dec8 = [n({ type: String, reflect: true })], _placeholder_dec7 = [n({ type: String, reflect: true })], _searchLabel_dec2 = [n({ type: String, reflect: true })], _documentKey_dec = [n({ type: String, reflect: true })], _disabled_dec6 = [n({ type: Boolean, reflect: true })], _loadError_dec3 = [r2()], _a94) {
|
|
69913
70219
|
constructor() {
|
|
69914
70220
|
super(...arguments);
|
|
69915
70221
|
__publicField(this, "t", dcLocalize(this));
|
|
69916
70222
|
__privateAdd(this, _value17, __runInitializers(_init95, 8, this, [])), __runInitializers(_init95, 11, this);
|
|
69917
|
-
__privateAdd(this,
|
|
70223
|
+
__privateAdd(this, _searchReferences2, __runInitializers(_init95, 12, this)), __runInitializers(_init95, 15, this);
|
|
69918
70224
|
__privateAdd(this, _trigger, __runInitializers(_init95, 16, this, "#_")), __runInitializers(_init95, 19, this);
|
|
69919
70225
|
__privateAdd(this, _label8, __runInitializers(_init95, 20, this, "")), __runInitializers(_init95, 23, this);
|
|
69920
70226
|
__privateAdd(this, _placeholder7, __runInitializers(_init95, 24, this, "")), __runInitializers(_init95, 27, this);
|
|
@@ -69925,9 +70231,20 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
69925
70231
|
__publicField(this, "editor");
|
|
69926
70232
|
__publicField(this, "initializing");
|
|
69927
70233
|
__publicField(this, "connection", 0);
|
|
69928
|
-
__publicField(this, "
|
|
69929
|
-
|
|
69930
|
-
|
|
70234
|
+
__publicField(this, "picker", new ReferencePicker({
|
|
70235
|
+
element: this,
|
|
70236
|
+
editor: /* @__PURE__ */ __name(() => this.editor, "editor"),
|
|
70237
|
+
search: /* @__PURE__ */ __name(() => this.searchReferences, "search"),
|
|
70238
|
+
searchLabel: /* @__PURE__ */ __name(() => this.searchLabel || this.t("reference.search"), "searchLabel"),
|
|
70239
|
+
i18n: /* @__PURE__ */ __name(() => this.t.i18n, "i18n"),
|
|
70240
|
+
disabled: /* @__PURE__ */ __name(() => this.disabled, "disabled"),
|
|
70241
|
+
failed: /* @__PURE__ */ __name((error) => {
|
|
70242
|
+
this.loadError = error instanceof Error ? error.message : this.t("reference.searchFailed");
|
|
70243
|
+
}, "failed"),
|
|
70244
|
+
opened: /* @__PURE__ */ __name(() => {
|
|
70245
|
+
this.loadError = "";
|
|
70246
|
+
}, "opened")
|
|
70247
|
+
}));
|
|
69931
70248
|
__publicField(this, "serializedValue", "");
|
|
69932
70249
|
}
|
|
69933
70250
|
render() {
|
|
@@ -69950,38 +70267,25 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
69950
70267
|
const connection = this.connection;
|
|
69951
70268
|
const operation = (async () => {
|
|
69952
70269
|
await this.updateComplete;
|
|
69953
|
-
const
|
|
70270
|
+
const bundle = await DeesServiceLibLoader.getInstance().loadTiptap();
|
|
70271
|
+
const { Editor, StarterKit } = bundle;
|
|
69954
70272
|
if (!this.isConnected || connection !== this.connection) return;
|
|
69955
|
-
const referenceNode = Node2.create({
|
|
69956
|
-
name: "catalogReference",
|
|
69957
|
-
group: "inline",
|
|
69958
|
-
inline: true,
|
|
69959
|
-
atom: true,
|
|
69960
|
-
selectable: true,
|
|
69961
|
-
addAttributes: /* @__PURE__ */ __name(() => ({
|
|
69962
|
-
id: { default: "", parseHTML: /* @__PURE__ */ __name((element) => element.getAttribute("data-reference-id"), "parseHTML") },
|
|
69963
|
-
label: { default: "", parseHTML: /* @__PURE__ */ __name((element) => element.textContent, "parseHTML") }
|
|
69964
|
-
}), "addAttributes"),
|
|
69965
|
-
parseHTML: /* @__PURE__ */ __name(() => [{ tag: "span[data-reference-id]" }], "parseHTML"),
|
|
69966
|
-
renderHTML: /* @__PURE__ */ __name(({ node }) => ["span", { "data-reference-id": String(node.attrs.id), contenteditable: "false", role: "link", tabindex: "0" }, String(node.attrs.label)], "renderHTML"),
|
|
69967
|
-
renderText: /* @__PURE__ */ __name(({ node }) => String(node.attrs.label), "renderText")
|
|
69968
|
-
});
|
|
69969
70273
|
this.editor = new Editor({
|
|
69970
70274
|
element: this.shadowRoot.querySelector(".editor"),
|
|
69971
70275
|
injectCSS: false,
|
|
69972
70276
|
editable: !this.disabled,
|
|
69973
|
-
extensions: [StarterKit.configure({ blockquote: false, bold: false, bulletList: false, code: false, codeBlock: false, heading: false, horizontalRule: false, italic: false, listItem: false, orderedList: false, strike: false }), referenceNode],
|
|
70277
|
+
extensions: [StarterKit.configure({ blockquote: false, bold: false, bulletList: false, code: false, codeBlock: false, heading: false, horizontalRule: false, italic: false, listItem: false, orderedList: false, strike: false }), referenceNode(bundle)],
|
|
69974
70278
|
content: referenceDocument(this.value),
|
|
69975
70279
|
editorProps: {
|
|
69976
70280
|
attributes: { role: "textbox", "aria-multiline": "true", "aria-label": this.label || this.t("reference.label"), "data-placeholder": this.placeholder || this.t("reference.placeholder") },
|
|
69977
|
-
handleClickOn: /* @__PURE__ */ __name((
|
|
70281
|
+
handleClickOn: /* @__PURE__ */ __name((_view3, _position5, node, _nodePosition, event, direct) => {
|
|
69978
70282
|
if (!direct || node.type.name !== "catalogReference") return false;
|
|
69979
70283
|
event.preventDefault();
|
|
69980
70284
|
this.openReference({ id: String(node.attrs.id), label: String(node.attrs.label) });
|
|
69981
70285
|
return true;
|
|
69982
70286
|
}, "handleClickOn"),
|
|
69983
70287
|
handleDOMEvents: {
|
|
69984
|
-
keydown: /* @__PURE__ */ __name((
|
|
70288
|
+
keydown: /* @__PURE__ */ __name((_view3, event) => {
|
|
69985
70289
|
const target = event.target;
|
|
69986
70290
|
if (event.key === "Enter" && target.dataset.referenceId) {
|
|
69987
70291
|
event.preventDefault();
|
|
@@ -69996,7 +70300,7 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
69996
70300
|
return false;
|
|
69997
70301
|
}, "keydown"),
|
|
69998
70302
|
compositionend: /* @__PURE__ */ __name(() => {
|
|
69999
|
-
queueMicrotask(() => this.
|
|
70303
|
+
queueMicrotask(() => this.picker.detect(this.trigger));
|
|
70000
70304
|
return false;
|
|
70001
70305
|
}, "compositionend")
|
|
70002
70306
|
}
|
|
@@ -70005,7 +70309,7 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
70005
70309
|
this.value = referenceContent(editor.getJSON());
|
|
70006
70310
|
this.serializedValue = JSON.stringify(this.value);
|
|
70007
70311
|
this.dispatchEvent(new CustomEvent("reference-input", { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
70008
|
-
if (!transaction.getMeta(
|
|
70312
|
+
if (!transaction.getMeta(referenceInsertMeta)) this.picker.detect(this.trigger);
|
|
70009
70313
|
}, "onUpdate")
|
|
70010
70314
|
});
|
|
70011
70315
|
this.serializedValue = JSON.stringify(this.value);
|
|
@@ -70021,7 +70325,7 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
70021
70325
|
updated(changed3) {
|
|
70022
70326
|
if (changed3.has("documentKey") && changed3.get("documentKey") !== void 0 && this.editor) {
|
|
70023
70327
|
this.connection++;
|
|
70024
|
-
void this.
|
|
70328
|
+
void this.picker.close(false);
|
|
70025
70329
|
this.editor.destroy();
|
|
70026
70330
|
this.editor = void 0;
|
|
70027
70331
|
this.initializing = void 0;
|
|
@@ -70029,10 +70333,10 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
70029
70333
|
}
|
|
70030
70334
|
if (changed3.has("disabled")) {
|
|
70031
70335
|
this.editor?.setEditable(!this.disabled, false);
|
|
70032
|
-
if (this.disabled) void this.
|
|
70336
|
+
if (this.disabled) void this.picker.close(false);
|
|
70033
70337
|
}
|
|
70034
70338
|
if (changed3.has("value") && this.editor && JSON.stringify(this.value) !== this.serializedValue) {
|
|
70035
|
-
void this.
|
|
70339
|
+
void this.picker.close(false);
|
|
70036
70340
|
this.editor.commands.setContent(referenceDocument(this.value), false);
|
|
70037
70341
|
this.serializedValue = JSON.stringify(this.value);
|
|
70038
70342
|
}
|
|
@@ -70044,77 +70348,12 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
70044
70348
|
focus(options) {
|
|
70045
70349
|
this.editor?.view.dom.focus(options);
|
|
70046
70350
|
}
|
|
70047
|
-
detectTrigger() {
|
|
70048
|
-
const editor = this.editor;
|
|
70049
|
-
if (!editor || this.disabled || this.popup || !this.searchReferences || !this.trigger || editor.view.composing || !editor.isFocused) return;
|
|
70050
|
-
const { from, to, $from } = editor.state.selection;
|
|
70051
|
-
if (from !== to || $from.parentOffset < this.trigger.length) return;
|
|
70052
|
-
if ($from.parent.textBetween($from.parentOffset - this.trigger.length, $from.parentOffset, "", "\uFFFC") !== this.trigger) return;
|
|
70053
|
-
this.referenceRange = { from: from - this.trigger.length, to };
|
|
70054
|
-
void this.openPicker();
|
|
70055
|
-
}
|
|
70056
|
-
positionPicker() {
|
|
70057
|
-
if (!this.editor || !this.popup || !this.referenceRange) return;
|
|
70058
|
-
const coords = this.editor.view.coordsAtPos(this.referenceRange.to);
|
|
70059
|
-
const { node } = this.editor.view.domAtPos(this.referenceRange.to);
|
|
70060
|
-
this.popup.triggerElement = node instanceof HTMLElement ? node : node.parentElement;
|
|
70061
|
-
this.popup.triggerRect = new DOMRect(coords.left, coords.top, 340, coords.bottom - coords.top);
|
|
70062
|
-
this.popup.opensToTop = window.innerHeight - coords.bottom < 300 && coords.top > window.innerHeight - coords.bottom;
|
|
70063
|
-
}
|
|
70064
|
-
async openPicker() {
|
|
70065
|
-
const popup = this.popup = new DeesInputDropdownPopup();
|
|
70066
|
-
popup.ownerComponent = this;
|
|
70067
|
-
popup.searchLabel = this.searchLabel || this.t("reference.search");
|
|
70068
|
-
provideOverlayI18n(popup, { i18n: this.t.i18n });
|
|
70069
|
-
popup.searchOptions = async (query2, signal) => (await this.searchReferences(query2, signal)).map((reference) => ({ key: reference.id, option: reference.label, payload: reference }));
|
|
70070
|
-
this.positionPicker();
|
|
70071
|
-
popup.addEventListener("reposition-request", () => this.positionPicker());
|
|
70072
|
-
popup.addEventListener("close-request", () => {
|
|
70073
|
-
void this.closePicker(true);
|
|
70074
|
-
});
|
|
70075
|
-
popup.addEventListener("keydown", (event) => {
|
|
70076
|
-
if (event.key === "Tab") {
|
|
70077
|
-
event.preventDefault();
|
|
70078
|
-
void this.closePicker(true);
|
|
70079
|
-
}
|
|
70080
|
-
});
|
|
70081
|
-
popup.addEventListener("option-selected", (event) => {
|
|
70082
|
-
const reference = event.detail.payload;
|
|
70083
|
-
const range = this.referenceRange;
|
|
70084
|
-
if (range && this.editor && !this.disabled) {
|
|
70085
|
-
this.editor.chain().setMeta("preventReferenceTrigger", true).insertContentAt(range, [
|
|
70086
|
-
{ type: "catalogReference", attrs: reference },
|
|
70087
|
-
{ type: "text", text: " " }
|
|
70088
|
-
]).run();
|
|
70089
|
-
}
|
|
70090
|
-
void this.closePicker(true);
|
|
70091
|
-
});
|
|
70092
|
-
this.popupOpening = popup.show();
|
|
70093
|
-
try {
|
|
70094
|
-
await this.popupOpening;
|
|
70095
|
-
if (this.popup === popup && this.isConnected && !this.disabled) await popup.focusSearchInput();
|
|
70096
|
-
} catch (error) {
|
|
70097
|
-
this.loadError = error instanceof Error ? error.message : this.t("reference.searchFailed");
|
|
70098
|
-
void this.closePicker(false);
|
|
70099
|
-
}
|
|
70100
|
-
}
|
|
70101
|
-
async closePicker(restoreFocus) {
|
|
70102
|
-
const popup = this.popup;
|
|
70103
|
-
const editor = this.editor;
|
|
70104
|
-
const opening = this.popupOpening;
|
|
70105
|
-
this.popup = void 0;
|
|
70106
|
-
this.referenceRange = void 0;
|
|
70107
|
-
if (!popup) return;
|
|
70108
|
-
await opening?.catch(() => void 0);
|
|
70109
|
-
await popup.hide();
|
|
70110
|
-
if (restoreFocus && this.isConnected && !this.disabled && this.editor === editor) editor?.commands.focus();
|
|
70111
|
-
}
|
|
70112
70351
|
openReference(reference) {
|
|
70113
70352
|
this.dispatchEvent(new CustomEvent("reference-open", { detail: reference, bubbles: true, composed: true }));
|
|
70114
70353
|
}
|
|
70115
70354
|
async disconnectedCallback() {
|
|
70116
70355
|
this.connection++;
|
|
70117
|
-
void this.
|
|
70356
|
+
void this.picker.close(false);
|
|
70118
70357
|
this.editor?.destroy();
|
|
70119
70358
|
this.editor = void 0;
|
|
70120
70359
|
this.initializing = void 0;
|
|
@@ -70123,7 +70362,7 @@ var _DeesInputReference = class _DeesInputReference extends (_a94 = DeesElement,
|
|
|
70123
70362
|
};
|
|
70124
70363
|
_init95 = __decoratorStart(_a94);
|
|
70125
70364
|
_value17 = new WeakMap();
|
|
70126
|
-
|
|
70365
|
+
_searchReferences2 = new WeakMap();
|
|
70127
70366
|
_trigger = new WeakMap();
|
|
70128
70367
|
_label8 = new WeakMap();
|
|
70129
70368
|
_placeholder7 = new WeakMap();
|
|
@@ -70132,7 +70371,7 @@ _documentKey = new WeakMap();
|
|
|
70132
70371
|
_disabled6 = new WeakMap();
|
|
70133
70372
|
_loadError3 = new WeakMap();
|
|
70134
70373
|
__decorateElement(_init95, 4, "value", _value_dec17, _DeesInputReference, _value17);
|
|
70135
|
-
__decorateElement(_init95, 4, "searchReferences",
|
|
70374
|
+
__decorateElement(_init95, 4, "searchReferences", _searchReferences_dec2, _DeesInputReference, _searchReferences2);
|
|
70136
70375
|
__decorateElement(_init95, 4, "trigger", _trigger_dec, _DeesInputReference, _trigger);
|
|
70137
70376
|
__decorateElement(_init95, 4, "label", _label_dec8, _DeesInputReference, _label8);
|
|
70138
70377
|
__decorateElement(_init95, 4, "placeholder", _placeholder_dec7, _DeesInputReference, _placeholder7);
|
|
@@ -70177,7 +70416,7 @@ var renderThreadMarkdown = /* @__PURE__ */ __name(async (markdownArg) => {
|
|
|
70177
70416
|
markdownArg,
|
|
70178
70417
|
richtextMarkdownRenderOptions
|
|
70179
70418
|
);
|
|
70180
|
-
const processed = rendered.replaceAll("<a href=", '<a target="_blank" rel="noopener noreferrer" href=');
|
|
70419
|
+
const processed = rendered.replaceAll('<a href="#reference:', '<a class="reference" data-reference href="#reference:').replaceAll("<a href=", '<a target="_blank" rel="noopener noreferrer" href=');
|
|
70181
70420
|
cache.set(markdownArg, processed);
|
|
70182
70421
|
if (cache.size > maxCacheEntries) {
|
|
70183
70422
|
const oldest = cache.keys().next().value;
|
|
@@ -70236,7 +70475,7 @@ var conversation = /* @__PURE__ */ __name(() => ({
|
|
|
70236
70475
|
author: lukas,
|
|
70237
70476
|
createdAt: ago(185),
|
|
70238
70477
|
actions: entryActions,
|
|
70239
|
-
body: "Booked the \u20AC84 on account `4288
|
|
70478
|
+
body: "Booked the \u20AC84 on account `4288`: [#2026-0314 Home office March](#reference:booking-2026-0314).",
|
|
70240
70479
|
attachments: [
|
|
70241
70480
|
{ id: "booking-4288", name: "Booking 2026-0314.pdf", url: "https://example.com/bookings/2026-0314.pdf", size: 31904 },
|
|
70242
70481
|
{ id: "rent-march", name: "Rent March.pdf", url: "https://example.com/bookings/rent-march.pdf", size: 1284113 }
|
|
@@ -70250,6 +70489,12 @@ var conversation = /* @__PURE__ */ __name(() => ({
|
|
|
70250
70489
|
{ id: "e4", kind: "linked", actor: lukas, createdAt: ago(184), subject: "Booking 2026-0314", subjectId: "booking-2026-0314" }
|
|
70251
70490
|
]
|
|
70252
70491
|
}), "conversation");
|
|
70492
|
+
var bookings = [
|
|
70493
|
+
{ id: "booking-2026-0314", label: "#2026-0314 Home office March" },
|
|
70494
|
+
{ id: "booking-2026-0302", label: "#2026-0302 Rent March" },
|
|
70495
|
+
{ id: "booking-2026-0219", label: "#2026-0219 Rent February" }
|
|
70496
|
+
];
|
|
70497
|
+
var searchBookings = /* @__PURE__ */ __name(async (queryArg) => bookings.filter((booking) => booking.label.toLowerCase().includes(queryArg.toLowerCase())), "searchBookings");
|
|
70253
70498
|
var delay4 = /* @__PURE__ */ __name((msArg) => new Promise((resolve) => setTimeout(resolve, msArg)), "delay");
|
|
70254
70499
|
_DeesDemoThreadIssue_decorators = [customElement("dees-demo-thread-issue")];
|
|
70255
70500
|
var _DeesDemoThreadIssue = class _DeesDemoThreadIssue extends (_a95 = DeesElement, _entries_dec2 = [r2()], _events_dec3 = [r2()], _closed_dec = [r2()], _refuseNext_dec = [r2()], _a95) {
|
|
@@ -70297,13 +70542,14 @@ var _DeesDemoThreadIssue = class _DeesDemoThreadIssue extends (_a95 = DeesElemen
|
|
|
70297
70542
|
}}></dees-input-checkbox>
|
|
70298
70543
|
<dees-thread threadId="question-0314" .entries=${this.entries} .events=${this.events} .currentUser=${mara}
|
|
70299
70544
|
.onSubmit=${this.submit} .composerActions=${this.closed ? this.reopenAction : this.closeAction}
|
|
70545
|
+
.searchReferences=${searchBookings} referenceSearchLabel="Search bookings"
|
|
70300
70546
|
.composerInfo=${"Jonas Weber and the Ledger assistant see your reply. A reply from you reopens the question; a reply from anyone else marks it answered."}
|
|
70301
70547
|
@thread-action=${(event) => showDemoResult(this, { action: event.detail.action, entry: event.detail.entry.id })}
|
|
70302
70548
|
@thread-reference-open=${(event) => showDemoResult(this, { open: event.detail.id })}
|
|
70303
70549
|
@thread-attachment-open=${(event) => showDemoResult(this, { attachment: event.detail.attachment.id })}
|
|
70304
70550
|
@thread-submit=${(event) => showDemoResult(this, event.detail)}
|
|
70305
70551
|
></dees-thread>
|
|
70306
|
-
${demoOutput("Reply, close or reopen the question; open a comment's menu.")}
|
|
70552
|
+
${demoOutput("Reply, close or reopen the question; type # to link a booking; open a comment's menu or a booking.")}
|
|
70307
70553
|
`;
|
|
70308
70554
|
}
|
|
70309
70555
|
};
|
|
@@ -70370,12 +70616,21 @@ var demoFunc66 = /* @__PURE__ */ __name(() => demoPage(
|
|
|
70370
70616
|
"Thread",
|
|
70371
70617
|
"A conversation about a record, as an issue tracker shows one: comments by people and agents, what happened between them, and a composer at its end.",
|
|
70372
70618
|
b`
|
|
70373
|
-
${demoSection("A question", "Two people, a tax advisor and the agent answering on the advisor's behalf. Replying makes the agent answer; closing turns the action into Reopen.", b`
|
|
70619
|
+
${demoSection("A question", "Two people, a tax advisor and the agent answering on the advisor's behalf. Replying makes the agent answer; # in a reply links a booking, which opens as thread-reference-open; closing turns the action into Reopen.", b`
|
|
70374
70620
|
<dees-demo-thread-issue></dees-demo-thread-issue>
|
|
70375
70621
|
`)}
|
|
70376
70622
|
${demoSection("A long thread", "More items than collapseAfter: the middle collapses until the reader loads it.", b`
|
|
70377
70623
|
<dees-thread threadId="trip" .entries=${longThread().entries} .events=${longThread().events} .currentUser=${mara}></dees-thread>
|
|
70378
70624
|
`)}
|
|
70625
|
+
${demoSection("The composer apart", `A host that places the composer apart renders the thread twice, with the same properties: view="entries" for the timeline and view="composer" for the composer, here pinned under the timeline as a ticket's detail does.`, b`
|
|
70626
|
+
<div style="display: flex; flex-direction: column; height: 480px; overflow: hidden; border: var(--dees-line-width-hairline) solid var(--dees-color-border-default); border-radius: var(--dees-radius-lg);">
|
|
70627
|
+
<div style="flex: 1; min-height: 0; overflow: auto; padding: var(--dees-spacing-md) var(--dees-spacing-lg);">
|
|
70628
|
+
<dees-thread threadId="trip-apart" view="entries" .collapseAfter=${100} .entries=${longThread().entries} .events=${longThread().events} .currentUser=${mara}></dees-thread>
|
|
70629
|
+
</div>
|
|
70630
|
+
<dees-thread threadId="trip-apart" view="composer" .currentUser=${mara}
|
|
70631
|
+
style="padding: var(--dees-spacing-md) var(--dees-spacing-lg) var(--dees-spacing-lg); border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);"></dees-thread>
|
|
70632
|
+
</div>
|
|
70633
|
+
`)}
|
|
70379
70634
|
${demoSection("Read-only", "A closed question the reader may read but not answer; dates in full.", b`
|
|
70380
70635
|
<dees-thread threadId="vat" timeFormat="absolute" readOnly readOnlyReason="This question is closed. Only its owner can reopen it."
|
|
70381
70636
|
.entries=${closedThread().entries} .events=${closedThread().events}></dees-thread>
|
|
@@ -70398,7 +70653,7 @@ var demoFunc66 = /* @__PURE__ */ __name(() => demoPage(
|
|
|
70398
70653
|
), "demoFunc");
|
|
70399
70654
|
|
|
70400
70655
|
// ts_web/elements/00group-dataview/dees-thread/dees-thread.ts
|
|
70401
|
-
var _postErrors_dec, _postingThreads_dec, _revealed_dec, _timeFormat_dec3, _collapseAfter_dec, _error_dec3, _loading_dec7, _readOnlyReason_dec, _readOnly_dec, _placeholder_dec8, _draft_dec2,
|
|
70656
|
+
var _postErrors_dec, _postingThreads_dec, _revealed_dec, _timeFormat_dec3, _collapseAfter_dec, _error_dec3, _loading_dec7, _view_dec, _readOnlyReason_dec, _readOnly_dec, _placeholder_dec8, _draft_dec2, _referenceSearchLabel_dec2, _searchReferences_dec3, _format_dec2, _composerInfo_dec, _composerActions_dec, _submitLabel_dec, _onSubmit_dec, _currentUser_dec, _events_dec4, _entries_dec3, _threadId_dec, _a96, _DeesThread_decorators, _init97, _threadId, _entries3, _events4, _currentUser, _onSubmit, _submitLabel, _composerActions, _composerInfo, _format2, _searchReferences3, _referenceSearchLabel2, _draft2, _placeholder8, _readOnly, _readOnlyReason, _view, _loading7, _error3, _collapseAfter, _timeFormat3, _revealed, _postingThreads, _postErrors;
|
|
70402
70657
|
var eventIcons = {
|
|
70403
70658
|
opened: "lucide:CircleDot",
|
|
70404
70659
|
answered: "lucide:Check",
|
|
@@ -70444,7 +70699,7 @@ var safeHref2 = /* @__PURE__ */ __name((hrefArg) => {
|
|
|
70444
70699
|
}
|
|
70445
70700
|
}, "safeHref");
|
|
70446
70701
|
_DeesThread_decorators = [customElement("dees-thread")];
|
|
70447
|
-
var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec = [n({ type: String, reflect: true })], _entries_dec3 = [n({ attribute: false })], _events_dec4 = [n({ attribute: false })], _currentUser_dec = [n({ attribute: false })], _onSubmit_dec = [n({ attribute: false })], _submitLabel_dec = [n({ type: String, reflect: true })], _composerActions_dec = [n({ attribute: false })], _composerInfo_dec = [n({ attribute: false })], _format_dec2 = [n({ type: String, reflect: true })],
|
|
70702
|
+
var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec = [n({ type: String, reflect: true })], _entries_dec3 = [n({ attribute: false })], _events_dec4 = [n({ attribute: false })], _currentUser_dec = [n({ attribute: false })], _onSubmit_dec = [n({ attribute: false })], _submitLabel_dec = [n({ type: String, reflect: true })], _composerActions_dec = [n({ attribute: false })], _composerInfo_dec = [n({ attribute: false })], _format_dec2 = [n({ type: String, reflect: true })], _searchReferences_dec3 = [n({ attribute: false })], _referenceSearchLabel_dec2 = [n({ type: String, reflect: true })], _draft_dec2 = [n({ attribute: false })], _placeholder_dec8 = [n({ type: String, reflect: true })], _readOnly_dec = [n({ type: Boolean, reflect: true })], _readOnlyReason_dec = [n({ type: String, reflect: true })], _view_dec = [n({ type: String, reflect: true })], _loading_dec7 = [n({ type: Boolean, reflect: true })], _error_dec3 = [n({ type: String, reflect: true })], _collapseAfter_dec = [n({ type: Number, reflect: true })], _timeFormat_dec3 = [n({ type: String, reflect: true })], _revealed_dec = [r2()], _postingThreads_dec = [r2()], _postErrors_dec = [r2()], _a96) {
|
|
70448
70703
|
constructor() {
|
|
70449
70704
|
super(...arguments);
|
|
70450
70705
|
__publicField(this, "t", dcLocalize(this));
|
|
@@ -70457,23 +70712,33 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70457
70712
|
__privateAdd(this, _composerActions, __runInitializers(_init97, 32, this, [])), __runInitializers(_init97, 35, this);
|
|
70458
70713
|
__privateAdd(this, _composerInfo, __runInitializers(_init97, 36, this)), __runInitializers(_init97, 39, this);
|
|
70459
70714
|
__privateAdd(this, _format2, __runInitializers(_init97, 40, this, "markdown")), __runInitializers(_init97, 43, this);
|
|
70460
|
-
__privateAdd(this,
|
|
70461
|
-
__privateAdd(this,
|
|
70462
|
-
__privateAdd(this,
|
|
70463
|
-
__privateAdd(this,
|
|
70464
|
-
__privateAdd(this,
|
|
70465
|
-
__privateAdd(this,
|
|
70466
|
-
__privateAdd(this,
|
|
70467
|
-
__privateAdd(this,
|
|
70468
|
-
__privateAdd(this,
|
|
70469
|
-
__privateAdd(this,
|
|
70470
|
-
__privateAdd(this,
|
|
70471
|
-
__privateAdd(this,
|
|
70715
|
+
__privateAdd(this, _searchReferences3, __runInitializers(_init97, 44, this)), __runInitializers(_init97, 47, this);
|
|
70716
|
+
__privateAdd(this, _referenceSearchLabel2, __runInitializers(_init97, 48, this, "")), __runInitializers(_init97, 51, this);
|
|
70717
|
+
__privateAdd(this, _draft2, __runInitializers(_init97, 52, this, "")), __runInitializers(_init97, 55, this);
|
|
70718
|
+
__privateAdd(this, _placeholder8, __runInitializers(_init97, 56, this, "")), __runInitializers(_init97, 59, this);
|
|
70719
|
+
__privateAdd(this, _readOnly, __runInitializers(_init97, 60, this, false)), __runInitializers(_init97, 63, this);
|
|
70720
|
+
__privateAdd(this, _readOnlyReason, __runInitializers(_init97, 64, this, "")), __runInitializers(_init97, 67, this);
|
|
70721
|
+
__privateAdd(this, _view, __runInitializers(_init97, 68, this, "full")), __runInitializers(_init97, 71, this);
|
|
70722
|
+
__privateAdd(this, _loading7, __runInitializers(_init97, 72, this, false)), __runInitializers(_init97, 75, this);
|
|
70723
|
+
__privateAdd(this, _error3, __runInitializers(_init97, 76, this, "")), __runInitializers(_init97, 79, this);
|
|
70724
|
+
__privateAdd(this, _collapseAfter, __runInitializers(_init97, 80, this, 30)), __runInitializers(_init97, 83, this);
|
|
70725
|
+
__privateAdd(this, _timeFormat3, __runInitializers(_init97, 84, this, "relative")), __runInitializers(_init97, 87, this);
|
|
70726
|
+
__privateAdd(this, _revealed, __runInitializers(_init97, 88, this, 0)), __runInitializers(_init97, 91, this);
|
|
70727
|
+
__privateAdd(this, _postingThreads, __runInitializers(_init97, 92, this, /* @__PURE__ */ new Set())), __runInitializers(_init97, 95, this);
|
|
70728
|
+
__privateAdd(this, _postErrors, __runInitializers(_init97, 96, this, /* @__PURE__ */ new Map())), __runInitializers(_init97, 99, this);
|
|
70472
70729
|
__publicField(this, "ticker");
|
|
70473
70730
|
__publicField(this, "menu");
|
|
70474
70731
|
__publicField(this, "menuOpening", false);
|
|
70475
70732
|
__publicField(this, "bodiesRendering", Promise.resolve());
|
|
70476
70733
|
__publicField(this, "footerMemo");
|
|
70734
|
+
/** A reference in a Markdown body opens its record, as one in a body with references does. */
|
|
70735
|
+
__publicField(this, "markdownClick", /* @__PURE__ */ __name((event) => {
|
|
70736
|
+
const link = event.target?.closest("a[data-reference]");
|
|
70737
|
+
if (!link) return;
|
|
70738
|
+
event.preventDefault();
|
|
70739
|
+
const id = referenceId(link.getAttribute("href"));
|
|
70740
|
+
if (id !== null) this.openReference(id, link.textContent ?? "");
|
|
70741
|
+
}, "markdownClick"));
|
|
70477
70742
|
/** Ctrl/⌘ Enter runs the primary, before the editor makes a line break of it. */
|
|
70478
70743
|
__publicField(this, "composerKeydown", {
|
|
70479
70744
|
handleEvent: /* @__PURE__ */ __name((event) => {
|
|
@@ -70517,6 +70782,7 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70517
70782
|
if (changed3.has("entries")) this.renderBodies();
|
|
70518
70783
|
}
|
|
70519
70784
|
render() {
|
|
70785
|
+
if (this.view === "composer") return this.readOnly ? this.renderReadOnly(true) : this.renderComposer(true);
|
|
70520
70786
|
const items = this.items();
|
|
70521
70787
|
const collapsing = this.collapseAfter > 0 && items.length > this.collapseAfter && collapsedHead + this.revealed + collapsedTail < items.length;
|
|
70522
70788
|
const head = collapsing ? items.slice(0, collapsedHead + this.revealed) : items;
|
|
@@ -70538,7 +70804,7 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70538
70804
|
${hidden ? this.renderCollapsed(hidden) : ""}
|
|
70539
70805
|
${directives_exports.repeat(tail, key, renderItem(tail))}
|
|
70540
70806
|
</ol>` : ""}
|
|
70541
|
-
${!items.length && (this.loading || this.error) ? "" : this.readOnly ? this.renderReadOnly(!items.length) : this.renderComposer(!items.length)}
|
|
70807
|
+
${this.view === "entries" || !items.length && (this.loading || this.error) ? "" : this.readOnly ? this.renderReadOnly(!items.length) : this.renderComposer(!items.length)}
|
|
70542
70808
|
`;
|
|
70543
70809
|
}
|
|
70544
70810
|
/**
|
|
@@ -70547,6 +70813,7 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70547
70813
|
*/
|
|
70548
70814
|
async submit(action) {
|
|
70549
70815
|
await this.updateComplete;
|
|
70816
|
+
if (this.view === "entries") return;
|
|
70550
70817
|
const footer = this.shadowRoot?.querySelector(".composerTile dees-actionfooter");
|
|
70551
70818
|
if (!action && footer) {
|
|
70552
70819
|
await footer.runPrimary();
|
|
@@ -70648,7 +70915,7 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70648
70915
|
return entry.delivery === "pending" && entry.author.kind === "agent" ? b`<span class="typing" aria-hidden="true"><i></i><i></i><i></i></span>` : "";
|
|
70649
70916
|
}
|
|
70650
70917
|
const rendered = threadMarkdownHtml(body);
|
|
70651
|
-
return rendered === void 0 ? b`<div class="plain">${body}</div>` : b`<div class="markdown-body">${o(rendered)}</div>`;
|
|
70918
|
+
return rendered === void 0 ? b`<div class="plain">${body}</div>` : b`<div class="markdown-body" @click=${this.markdownClick}>${o(rendered)}</div>`;
|
|
70652
70919
|
}
|
|
70653
70920
|
refusedActions(entry) {
|
|
70654
70921
|
const threadId = this.threadId;
|
|
@@ -70763,6 +71030,7 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70763
71030
|
@keydown=${this.composerKeydown}>
|
|
70764
71031
|
${this.format === "references" ? b`<dees-input-reference class="composerInput" .label=${this.t("thread.composer")} .placeholder=${placeholder}
|
|
70765
71032
|
.documentKey=${threadId} .value=${this.referenceDraft()} .searchReferences=${this.searchReferences}
|
|
71033
|
+
.searchLabel=${this.referenceSearchLabel}
|
|
70766
71034
|
@reference-input=${(event) => {
|
|
70767
71035
|
event.stopPropagation();
|
|
70768
71036
|
this.updateDraft(event.detail.value);
|
|
@@ -70774,13 +71042,18 @@ var _DeesThread = class _DeesThread extends (_a96 = DeesElement, _threadId_dec =
|
|
|
70774
71042
|
@reference-submit=${(event) => event.stopPropagation()}
|
|
70775
71043
|
></dees-input-reference>` : b`<dees-input-richtext class="composerInput" format="markdown" frameless auto-grow
|
|
70776
71044
|
.label=${this.t("thread.composer")} .labelPosition=${"none"} .placeholder=${placeholder}
|
|
70777
|
-
.minHeight=${128} .maxHeight=${360} .showWordCount=${false} .toolbar=${composerToolbar}
|
|
70778
|
-
.value=${bodyText(this.draft)}
|
|
71045
|
+
.minHeight=${this.view === "composer" ? 64 : 128} .maxHeight=${360} .showWordCount=${false} .toolbar=${composerToolbar}
|
|
71046
|
+
.value=${bodyText(this.draft)} .searchReferences=${this.searchReferences}
|
|
71047
|
+
.referenceSearchLabel=${this.referenceSearchLabel}
|
|
70779
71048
|
@input=${(event) => {
|
|
70780
71049
|
event.stopPropagation();
|
|
70781
71050
|
if (typeof event.detail?.value === "string") this.updateDraft(event.detail.value);
|
|
70782
71051
|
}}
|
|
70783
71052
|
@change=${(event) => event.stopPropagation()}
|
|
71053
|
+
@reference-open=${(event) => {
|
|
71054
|
+
event.stopPropagation();
|
|
71055
|
+
this.openReference(event.detail.id, event.detail.label);
|
|
71056
|
+
}}
|
|
70784
71057
|
></dees-input-richtext>`}
|
|
70785
71058
|
${postError ? b`<p class="postError" role="alert"><dees-icon icon="lucide:CircleAlert" .iconSize=${14} aria-hidden="true"></dees-icon><span>${postError}</span></p>` : ""}
|
|
70786
71059
|
<dees-actionfooter slot="footer" source="thread-composer" .actions=${this.footerActions()}
|
|
@@ -70917,11 +71190,13 @@ _submitLabel = new WeakMap();
|
|
|
70917
71190
|
_composerActions = new WeakMap();
|
|
70918
71191
|
_composerInfo = new WeakMap();
|
|
70919
71192
|
_format2 = new WeakMap();
|
|
70920
|
-
|
|
71193
|
+
_searchReferences3 = new WeakMap();
|
|
71194
|
+
_referenceSearchLabel2 = new WeakMap();
|
|
70921
71195
|
_draft2 = new WeakMap();
|
|
70922
71196
|
_placeholder8 = new WeakMap();
|
|
70923
71197
|
_readOnly = new WeakMap();
|
|
70924
71198
|
_readOnlyReason = new WeakMap();
|
|
71199
|
+
_view = new WeakMap();
|
|
70925
71200
|
_loading7 = new WeakMap();
|
|
70926
71201
|
_error3 = new WeakMap();
|
|
70927
71202
|
_collapseAfter = new WeakMap();
|
|
@@ -70938,11 +71213,13 @@ __decorateElement(_init97, 4, "submitLabel", _submitLabel_dec, _DeesThread, _sub
|
|
|
70938
71213
|
__decorateElement(_init97, 4, "composerActions", _composerActions_dec, _DeesThread, _composerActions);
|
|
70939
71214
|
__decorateElement(_init97, 4, "composerInfo", _composerInfo_dec, _DeesThread, _composerInfo);
|
|
70940
71215
|
__decorateElement(_init97, 4, "format", _format_dec2, _DeesThread, _format2);
|
|
70941
|
-
__decorateElement(_init97, 4, "searchReferences",
|
|
71216
|
+
__decorateElement(_init97, 4, "searchReferences", _searchReferences_dec3, _DeesThread, _searchReferences3);
|
|
71217
|
+
__decorateElement(_init97, 4, "referenceSearchLabel", _referenceSearchLabel_dec2, _DeesThread, _referenceSearchLabel2);
|
|
70942
71218
|
__decorateElement(_init97, 4, "draft", _draft_dec2, _DeesThread, _draft2);
|
|
70943
71219
|
__decorateElement(_init97, 4, "placeholder", _placeholder_dec8, _DeesThread, _placeholder8);
|
|
70944
71220
|
__decorateElement(_init97, 4, "readOnly", _readOnly_dec, _DeesThread, _readOnly);
|
|
70945
71221
|
__decorateElement(_init97, 4, "readOnlyReason", _readOnlyReason_dec, _DeesThread, _readOnlyReason);
|
|
71222
|
+
__decorateElement(_init97, 4, "view", _view_dec, _DeesThread, _view);
|
|
70946
71223
|
__decorateElement(_init97, 4, "loading", _loading_dec7, _DeesThread, _loading7);
|
|
70947
71224
|
__decorateElement(_init97, 4, "error", _error_dec3, _DeesThread, _error3);
|
|
70948
71225
|
__decorateElement(_init97, 4, "collapseAfter", _collapseAfter_dec, _DeesThread, _collapseAfter);
|
|
@@ -71218,6 +71495,12 @@ __publicField(_DeesThread, "styles", [
|
|
|
71218
71495
|
overflow-x: auto;
|
|
71219
71496
|
}
|
|
71220
71497
|
|
|
71498
|
+
.markdown-body a.reference,
|
|
71499
|
+
.markdown-body a.reference:hover {
|
|
71500
|
+
color: var(--dees-color-link);
|
|
71501
|
+
text-decoration: none;
|
|
71502
|
+
}
|
|
71503
|
+
|
|
71221
71504
|
.plain {
|
|
71222
71505
|
white-space: pre-wrap;
|
|
71223
71506
|
overflow-wrap: anywhere;
|
|
@@ -72818,7 +73101,7 @@ var _DeesHarnessConversationPicker = class _DeesHarnessConversationPicker extend
|
|
|
72818
73101
|
* cancelled. Focus returns to whatever had it when the picker opened.
|
|
72819
73102
|
*/
|
|
72820
73103
|
static async pick(optionsArg = {}) {
|
|
72821
|
-
const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-
|
|
73104
|
+
const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-BOGBX6EB.js");
|
|
72822
73105
|
const picker = new _DeesHarnessConversationPicker();
|
|
72823
73106
|
picker.sessions = optionsArg.sessions ?? [];
|
|
72824
73107
|
picker.groups = optionsArg.groups ?? [];
|
|
@@ -73279,7 +73562,7 @@ var handleResourceContext = /* @__PURE__ */ __name(async (event) => {
|
|
|
73279
73562
|
list.selectedResourceId = event.detail.resource.id;
|
|
73280
73563
|
}, "handleResourceContext");
|
|
73281
73564
|
var openModal = /* @__PURE__ */ __name(async (sessions, groups) => {
|
|
73282
|
-
const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-
|
|
73565
|
+
const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-BOGBX6EB.js");
|
|
73283
73566
|
const content = document.createElement("dees-harness-session-list");
|
|
73284
73567
|
content.sessions = sessions;
|
|
73285
73568
|
content.groups = groups;
|
|
@@ -76343,9 +76626,9 @@ var kanbanEvent = /* @__PURE__ */ __name((owner, name, detail) => {
|
|
|
76343
76626
|
var kanbanError = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "kanbanError");
|
|
76344
76627
|
|
|
76345
76628
|
// ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.ts
|
|
76346
|
-
var _showHeader_dec2, _error_dec4, _readOnly_dec2, _loading_dec9, _addComment_dec, _searchTickets_dec, _draft_dec3, _comments_dec, _ticketId_dec, _a103, _DeesKanbanDiscussion_decorators, _init104, _ticketId, _comments, _draft3, _searchTickets, _addComment, _loading9, _readOnly2, _error4, _showHeader2;
|
|
76629
|
+
var _showHeader_dec2, _error_dec4, _readOnly_dec2, _loading_dec9, _addComment_dec, _view_dec2, _currentPerson_dec, _searchTickets_dec, _draft_dec3, _comments_dec, _ticketId_dec, _a103, _DeesKanbanDiscussion_decorators, _init104, _ticketId, _comments, _draft3, _searchTickets, _currentPerson, _view2, _addComment, _loading9, _readOnly2, _error4, _showHeader2;
|
|
76347
76630
|
_DeesKanbanDiscussion_decorators = [customElement("dees-kanban-discussion")];
|
|
76348
|
-
var _DeesKanbanDiscussion = class _DeesKanbanDiscussion extends (_a103 = DeesElement, _ticketId_dec = [n({ type: String, reflect: true })], _comments_dec = [n({ attribute: false })], _draft_dec3 = [n({ attribute: false })], _searchTickets_dec = [n({ attribute: false })], _addComment_dec = [n({ attribute: false })], _loading_dec9 = [n({ type: Boolean, reflect: true })], _readOnly_dec2 = [n({ type: Boolean, reflect: true })], _error_dec4 = [n({ type: String, reflect: true })], _showHeader_dec2 = [n({ type: Boolean, reflect: true })], _a103) {
|
|
76631
|
+
var _DeesKanbanDiscussion = class _DeesKanbanDiscussion extends (_a103 = DeesElement, _ticketId_dec = [n({ type: String, reflect: true })], _comments_dec = [n({ attribute: false })], _draft_dec3 = [n({ attribute: false })], _searchTickets_dec = [n({ attribute: false })], _currentPerson_dec = [n({ attribute: false })], _view_dec2 = [n({ type: String, reflect: true })], _addComment_dec = [n({ attribute: false })], _loading_dec9 = [n({ type: Boolean, reflect: true })], _readOnly_dec2 = [n({ type: Boolean, reflect: true })], _error_dec4 = [n({ type: String, reflect: true })], _showHeader_dec2 = [n({ type: Boolean, reflect: true })], _a103) {
|
|
76349
76632
|
constructor() {
|
|
76350
76633
|
super(...arguments);
|
|
76351
76634
|
__publicField(this, "t", dcLocalize(this));
|
|
@@ -76353,19 +76636,23 @@ var _DeesKanbanDiscussion = class _DeesKanbanDiscussion extends (_a103 = DeesEle
|
|
|
76353
76636
|
__privateAdd(this, _comments, __runInitializers(_init104, 12, this, [])), __runInitializers(_init104, 15, this);
|
|
76354
76637
|
__privateAdd(this, _draft3, __runInitializers(_init104, 16, this, [])), __runInitializers(_init104, 19, this);
|
|
76355
76638
|
__privateAdd(this, _searchTickets, __runInitializers(_init104, 20, this)), __runInitializers(_init104, 23, this);
|
|
76356
|
-
__privateAdd(this,
|
|
76357
|
-
__privateAdd(this,
|
|
76358
|
-
__privateAdd(this,
|
|
76359
|
-
__privateAdd(this,
|
|
76360
|
-
__privateAdd(this,
|
|
76639
|
+
__privateAdd(this, _currentPerson, __runInitializers(_init104, 24, this)), __runInitializers(_init104, 27, this);
|
|
76640
|
+
__privateAdd(this, _view2, __runInitializers(_init104, 28, this, "full")), __runInitializers(_init104, 31, this);
|
|
76641
|
+
__privateAdd(this, _addComment, __runInitializers(_init104, 32, this)), __runInitializers(_init104, 35, this);
|
|
76642
|
+
__privateAdd(this, _loading9, __runInitializers(_init104, 36, this, false)), __runInitializers(_init104, 39, this);
|
|
76643
|
+
__privateAdd(this, _readOnly2, __runInitializers(_init104, 40, this, false)), __runInitializers(_init104, 43, this);
|
|
76644
|
+
__privateAdd(this, _error4, __runInitializers(_init104, 44, this, "")), __runInitializers(_init104, 47, this);
|
|
76645
|
+
__privateAdd(this, _showHeader2, __runInitializers(_init104, 48, this, true)), __runInitializers(_init104, 51, this);
|
|
76361
76646
|
/** The ticket's comments as the thread's entries, oldest first. */
|
|
76362
76647
|
__publicField(this, "threadEntries", []);
|
|
76648
|
+
/** The composer's Markdown the draft was read from, given back while the draft is unchanged. */
|
|
76649
|
+
__publicField(this, "draftSource");
|
|
76363
76650
|
/** Saves a comment; a refusal or a comment saved to another ticket stays in the composer. */
|
|
76364
76651
|
__publicField(this, "post", /* @__PURE__ */ __name(async ({ body }) => {
|
|
76365
76652
|
const ticketId = this.ticketId;
|
|
76366
76653
|
const addComment = this.addComment;
|
|
76367
|
-
if (!ticketId || !addComment ||
|
|
76368
|
-
const submittedBody = body
|
|
76654
|
+
if (!ticketId || !addComment || typeof body !== "string") return;
|
|
76655
|
+
const submittedBody = markdownToReferences(body);
|
|
76369
76656
|
const comment = await addComment({ ticketId, body: submittedBody });
|
|
76370
76657
|
if (comment.ticketId !== ticketId) throw new Error(this.t("kanban.commentMismatch"));
|
|
76371
76658
|
kanbanEvent(this, "kanban-comment-added", { comment, submittedBody });
|
|
@@ -76378,11 +76665,14 @@ var _DeesKanbanDiscussion = class _DeesKanbanDiscussion extends (_a103 = DeesEle
|
|
|
76378
76665
|
id: comment.id,
|
|
76379
76666
|
author: { id: comment.author.id, name: comment.author.name },
|
|
76380
76667
|
createdAt: comment.createdAt,
|
|
76381
|
-
body: comment.body
|
|
76668
|
+
body: referencesToMarkdown(comment.body)
|
|
76382
76669
|
}));
|
|
76383
76670
|
}
|
|
76671
|
+
threadDraft() {
|
|
76672
|
+
return this.draftSource?.draft === this.draft ? this.draftSource.markdown : referencesToMarkdown(this.draft);
|
|
76673
|
+
}
|
|
76384
76674
|
render() {
|
|
76385
|
-
return b`${this.showHeader ? b`<header>
|
|
76675
|
+
return b`${this.showHeader && this.view !== "composer" ? b`<header>
|
|
76386
76676
|
<h3>${this.t("kanban.discussion")}</h3>
|
|
76387
76677
|
<span class="count">${this.threadEntries.length}</span>
|
|
76388
76678
|
<span class="spacer"></span>
|
|
@@ -76397,12 +76687,14 @@ var _DeesKanbanDiscussion = class _DeesKanbanDiscussion extends (_a103 = DeesEle
|
|
|
76397
76687
|
></dees-button>
|
|
76398
76688
|
</header>` : ""}
|
|
76399
76689
|
<dees-thread
|
|
76400
|
-
format="references"
|
|
76401
76690
|
.threadId=${this.ticketId}
|
|
76402
76691
|
.entries=${this.threadEntries}
|
|
76403
|
-
.
|
|
76692
|
+
.currentUser=${this.currentPerson}
|
|
76693
|
+
.draft=${this.threadDraft()}
|
|
76404
76694
|
.placeholder=${this.t("kanban.commentPlaceholder")}
|
|
76405
76695
|
.searchReferences=${this.searchTickets}
|
|
76696
|
+
.referenceSearchLabel=${this.t("reference.search")}
|
|
76697
|
+
.view=${this.view}
|
|
76406
76698
|
.onSubmit=${this.post}
|
|
76407
76699
|
.readOnly=${this.readOnly || !this.addComment || !this.ticketId}
|
|
76408
76700
|
.readOnlyReason=${this.t("kanban.readOnly")}
|
|
@@ -76410,8 +76702,10 @@ var _DeesKanbanDiscussion = class _DeesKanbanDiscussion extends (_a103 = DeesEle
|
|
|
76410
76702
|
.error=${this.error}
|
|
76411
76703
|
@thread-draft=${(event) => {
|
|
76412
76704
|
event.stopPropagation();
|
|
76413
|
-
|
|
76414
|
-
|
|
76705
|
+
const markdown = event.detail.body;
|
|
76706
|
+
if (event.detail.threadId !== this.ticketId || typeof markdown !== "string") return;
|
|
76707
|
+
this.draft = markdownToReferences(markdown);
|
|
76708
|
+
this.draftSource = { draft: this.draft, markdown };
|
|
76415
76709
|
kanbanEvent(this, "kanban-comment-draft", { ticketId: this.ticketId, body: this.draft });
|
|
76416
76710
|
}}
|
|
76417
76711
|
@thread-reference-open=${(event) => {
|
|
@@ -76437,6 +76731,8 @@ _ticketId = new WeakMap();
|
|
|
76437
76731
|
_comments = new WeakMap();
|
|
76438
76732
|
_draft3 = new WeakMap();
|
|
76439
76733
|
_searchTickets = new WeakMap();
|
|
76734
|
+
_currentPerson = new WeakMap();
|
|
76735
|
+
_view2 = new WeakMap();
|
|
76440
76736
|
_addComment = new WeakMap();
|
|
76441
76737
|
_loading9 = new WeakMap();
|
|
76442
76738
|
_readOnly2 = new WeakMap();
|
|
@@ -76446,6 +76742,8 @@ __decorateElement(_init104, 4, "ticketId", _ticketId_dec, _DeesKanbanDiscussion,
|
|
|
76446
76742
|
__decorateElement(_init104, 4, "comments", _comments_dec, _DeesKanbanDiscussion, _comments);
|
|
76447
76743
|
__decorateElement(_init104, 4, "draft", _draft_dec3, _DeesKanbanDiscussion, _draft3);
|
|
76448
76744
|
__decorateElement(_init104, 4, "searchTickets", _searchTickets_dec, _DeesKanbanDiscussion, _searchTickets);
|
|
76745
|
+
__decorateElement(_init104, 4, "currentPerson", _currentPerson_dec, _DeesKanbanDiscussion, _currentPerson);
|
|
76746
|
+
__decorateElement(_init104, 4, "view", _view_dec2, _DeesKanbanDiscussion, _view2);
|
|
76449
76747
|
__decorateElement(_init104, 4, "addComment", _addComment_dec, _DeesKanbanDiscussion, _addComment);
|
|
76450
76748
|
__decorateElement(_init104, 4, "loading", _loading_dec9, _DeesKanbanDiscussion, _loading9);
|
|
76451
76749
|
__decorateElement(_init104, 4, "readOnly", _readOnly_dec2, _DeesKanbanDiscussion, _readOnly2);
|
|
@@ -76707,9 +77005,9 @@ __runInitializers(_init105, 1, _DeesKanbanActivity);
|
|
|
76707
77005
|
var DeesKanbanActivity = _DeesKanbanActivity;
|
|
76708
77006
|
|
|
76709
77007
|
// ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts
|
|
76710
|
-
var _feed_dec, _editing_dec3, _conflict_dec, _frameless_dec14, _showTicketKey_dec, _canGoBack_dec, _saving_dec2, _error_dec6, _projects_dec2, _activityError_dec, _loadingActivity_dec, _activity_dec2, _commentsError_dec, _loadingComments_dec, _searchTickets_dec2, _comments_dec2, _commentDraft_dec, _draft_dec4, _provider_dec3, _people_dec, _columns_dec4, _tickets_dec2, _ticket_dec, _a105, _DeesKanbanTicketDetail_decorators, _init106, _ticket, _tickets2, _columns4, _people, _provider3, _draft4, _commentDraft, _comments2, _searchTickets2, _loadingComments, _commentsError, _activity2, _loadingActivity, _activityError, _projects2, _error6, _saving2, _canGoBack, _showTicketKey, _frameless14, _conflict, _editing3, _feed;
|
|
77008
|
+
var _feed_dec, _editing_dec3, _conflict_dec, _frameless_dec14, _showTicketKey_dec, _canGoBack_dec, _saving_dec2, _error_dec6, _projects_dec2, _activityError_dec, _loadingActivity_dec, _activity_dec2, _commentsError_dec, _loadingComments_dec, _searchTickets_dec2, _comments_dec2, _commentDraft_dec, _draft_dec4, _provider_dec3, _currentPerson_dec2, _people_dec, _columns_dec4, _tickets_dec2, _ticket_dec, _a105, _DeesKanbanTicketDetail_decorators, _init106, _ticket, _tickets2, _columns4, _people, _currentPerson2, _provider3, _draft4, _commentDraft, _comments2, _searchTickets2, _loadingComments, _commentsError, _activity2, _loadingActivity, _activityError, _projects2, _error6, _saving2, _canGoBack, _showTicketKey, _frameless14, _conflict, _editing3, _feed;
|
|
76711
77009
|
_DeesKanbanTicketDetail_decorators = [customElement("dees-kanban-ticket-detail")];
|
|
76712
|
-
var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a105 = DeesElement, _ticket_dec = [n({ attribute: false })], _tickets_dec2 = [n({ attribute: false })], _columns_dec4 = [n({ attribute: false })], _people_dec = [n({ attribute: false })], _provider_dec3 = [n({ attribute: false })], _draft_dec4 = [n({ attribute: false })], _commentDraft_dec = [n({ attribute: false })], _comments_dec2 = [n({ attribute: false })], _searchTickets_dec2 = [n({ attribute: false })], _loadingComments_dec = [n({ type: Boolean, reflect: true })], _commentsError_dec = [n({ type: String, reflect: true })], _activity_dec2 = [n({ attribute: false })], _loadingActivity_dec = [n({ type: Boolean, reflect: true })], _activityError_dec = [n({ type: String, reflect: true })], _projects_dec2 = [n({ attribute: false })], _error_dec6 = [n({ type: String, reflect: true })], _saving_dec2 = [n({ type: Boolean, reflect: true })], _canGoBack_dec = [n({ type: Boolean, reflect: true })], _showTicketKey_dec = [n({ type: Boolean, reflect: true })], _frameless_dec14 = [n({ type: Boolean, reflect: true })], _conflict_dec = [n({ attribute: false })], _editing_dec3 = [r2()], _feed_dec = [r2()], _a105) {
|
|
77010
|
+
var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a105 = DeesElement, _ticket_dec = [n({ attribute: false })], _tickets_dec2 = [n({ attribute: false })], _columns_dec4 = [n({ attribute: false })], _people_dec = [n({ attribute: false })], _currentPerson_dec2 = [n({ attribute: false })], _provider_dec3 = [n({ attribute: false })], _draft_dec4 = [n({ attribute: false })], _commentDraft_dec = [n({ attribute: false })], _comments_dec2 = [n({ attribute: false })], _searchTickets_dec2 = [n({ attribute: false })], _loadingComments_dec = [n({ type: Boolean, reflect: true })], _commentsError_dec = [n({ type: String, reflect: true })], _activity_dec2 = [n({ attribute: false })], _loadingActivity_dec = [n({ type: Boolean, reflect: true })], _activityError_dec = [n({ type: String, reflect: true })], _projects_dec2 = [n({ attribute: false })], _error_dec6 = [n({ type: String, reflect: true })], _saving_dec2 = [n({ type: Boolean, reflect: true })], _canGoBack_dec = [n({ type: Boolean, reflect: true })], _showTicketKey_dec = [n({ type: Boolean, reflect: true })], _frameless_dec14 = [n({ type: Boolean, reflect: true })], _conflict_dec = [n({ attribute: false })], _editing_dec3 = [r2()], _feed_dec = [r2()], _a105) {
|
|
76713
77011
|
constructor() {
|
|
76714
77012
|
super(...arguments);
|
|
76715
77013
|
__publicField(this, "t", dcLocalize(this));
|
|
@@ -76717,28 +77015,33 @@ var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a105 = Dee
|
|
|
76717
77015
|
__privateAdd(this, _tickets2, __runInitializers(_init106, 12, this, [])), __runInitializers(_init106, 15, this);
|
|
76718
77016
|
__privateAdd(this, _columns4, __runInitializers(_init106, 16, this, [])), __runInitializers(_init106, 19, this);
|
|
76719
77017
|
__privateAdd(this, _people, __runInitializers(_init106, 20, this, [])), __runInitializers(_init106, 23, this);
|
|
76720
|
-
__privateAdd(this,
|
|
76721
|
-
__privateAdd(this,
|
|
76722
|
-
__privateAdd(this,
|
|
76723
|
-
__privateAdd(this,
|
|
76724
|
-
__privateAdd(this,
|
|
76725
|
-
__privateAdd(this,
|
|
76726
|
-
__privateAdd(this,
|
|
76727
|
-
__privateAdd(this,
|
|
76728
|
-
__privateAdd(this,
|
|
76729
|
-
__privateAdd(this,
|
|
76730
|
-
__privateAdd(this,
|
|
76731
|
-
__privateAdd(this,
|
|
76732
|
-
__privateAdd(this,
|
|
76733
|
-
__privateAdd(this,
|
|
76734
|
-
__privateAdd(this,
|
|
76735
|
-
__privateAdd(this,
|
|
76736
|
-
__privateAdd(this,
|
|
76737
|
-
__privateAdd(this,
|
|
77018
|
+
__privateAdd(this, _currentPerson2, __runInitializers(_init106, 24, this)), __runInitializers(_init106, 27, this);
|
|
77019
|
+
__privateAdd(this, _provider3, __runInitializers(_init106, 28, this, {})), __runInitializers(_init106, 31, this);
|
|
77020
|
+
__privateAdd(this, _draft4, __runInitializers(_init106, 32, this)), __runInitializers(_init106, 35, this);
|
|
77021
|
+
__privateAdd(this, _commentDraft, __runInitializers(_init106, 36, this, [])), __runInitializers(_init106, 39, this);
|
|
77022
|
+
__privateAdd(this, _comments2, __runInitializers(_init106, 40, this, [])), __runInitializers(_init106, 43, this);
|
|
77023
|
+
__privateAdd(this, _searchTickets2, __runInitializers(_init106, 44, this)), __runInitializers(_init106, 47, this);
|
|
77024
|
+
__privateAdd(this, _loadingComments, __runInitializers(_init106, 48, this, false)), __runInitializers(_init106, 51, this);
|
|
77025
|
+
__privateAdd(this, _commentsError, __runInitializers(_init106, 52, this, "")), __runInitializers(_init106, 55, this);
|
|
77026
|
+
__privateAdd(this, _activity2, __runInitializers(_init106, 56, this, [])), __runInitializers(_init106, 59, this);
|
|
77027
|
+
__privateAdd(this, _loadingActivity, __runInitializers(_init106, 60, this, false)), __runInitializers(_init106, 63, this);
|
|
77028
|
+
__privateAdd(this, _activityError, __runInitializers(_init106, 64, this, "")), __runInitializers(_init106, 67, this);
|
|
77029
|
+
__privateAdd(this, _projects2, __runInitializers(_init106, 68, this, [])), __runInitializers(_init106, 71, this);
|
|
77030
|
+
__privateAdd(this, _error6, __runInitializers(_init106, 72, this, "")), __runInitializers(_init106, 75, this);
|
|
77031
|
+
__privateAdd(this, _saving2, __runInitializers(_init106, 76, this, false)), __runInitializers(_init106, 79, this);
|
|
77032
|
+
__privateAdd(this, _canGoBack, __runInitializers(_init106, 80, this, false)), __runInitializers(_init106, 83, this);
|
|
77033
|
+
__privateAdd(this, _showTicketKey, __runInitializers(_init106, 84, this, true)), __runInitializers(_init106, 87, this);
|
|
77034
|
+
__privateAdd(this, _frameless14, __runInitializers(_init106, 88, this, false)), __runInitializers(_init106, 91, this);
|
|
77035
|
+
__privateAdd(this, _conflict, __runInitializers(_init106, 92, this)), __runInitializers(_init106, 95, this);
|
|
77036
|
+
__privateAdd(this, _editing3, __runInitializers(_init106, 96, this, false)), __runInitializers(_init106, 99, this);
|
|
76738
77037
|
/** The reader pressed a button of the refusal, which leaves with its answer: the focus follows. */
|
|
76739
77038
|
__publicField(this, "conflictFocus", false);
|
|
76740
|
-
__privateAdd(this, _feed, __runInitializers(_init106,
|
|
77039
|
+
__privateAdd(this, _feed, __runInitializers(_init106, 100, this, "comments")), __runInitializers(_init106, 103, this);
|
|
76741
77040
|
__publicField(this, "addComment", /* @__PURE__ */ __name((input) => this.provider.addComment(input), "addComment"));
|
|
77041
|
+
/** Keeps the comment the reader is writing, so that the next render gives the composer it back, not an older one. */
|
|
77042
|
+
__publicField(this, "keepCommentDraft", /* @__PURE__ */ __name((event) => {
|
|
77043
|
+
if (event.detail.ticketId === this.ticket?.id) this.commentDraft = event.detail.body;
|
|
77044
|
+
}, "keepCommentDraft"));
|
|
76742
77045
|
}
|
|
76743
77046
|
updated(changed3) {
|
|
76744
77047
|
const previous = changed3.get("ticket");
|
|
@@ -77112,22 +77415,36 @@ var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a105 = Dee
|
|
|
77112
77415
|
</section>` : ""}
|
|
77113
77416
|
${this.provider.loadActivity ? this.renderFeed(ticket) : this.renderDiscussion(ticket)}
|
|
77114
77417
|
</div>
|
|
77418
|
+
${this.renderComposer(ticket)}
|
|
77115
77419
|
</div>
|
|
77116
77420
|
</div>`;
|
|
77117
77421
|
}
|
|
77422
|
+
/** The discussion's comments; its composer is pinned apart, under the main column. */
|
|
77118
77423
|
renderDiscussion(ticket, inFeed = false) {
|
|
77119
77424
|
return b`<dees-kanban-discussion
|
|
77120
77425
|
class=${inFeed ? "" : "discussion"}
|
|
77426
|
+
.view=${"entries"}
|
|
77121
77427
|
.ticketId=${ticket.id}
|
|
77122
77428
|
.comments=${this.comments}
|
|
77123
|
-
.draft=${this.commentDraft}
|
|
77124
77429
|
.loading=${this.loadingComments}
|
|
77125
77430
|
.error=${this.commentsError}
|
|
77431
|
+
.showHeader=${!inFeed}
|
|
77432
|
+
?hidden=${inFeed && this.feed !== "comments"}
|
|
77433
|
+
></dees-kanban-discussion>`;
|
|
77434
|
+
}
|
|
77435
|
+
/** The discussion's composer, pinned under the main column; the history hides it, keeping its draft. */
|
|
77436
|
+
renderComposer(ticket) {
|
|
77437
|
+
return b`<dees-kanban-discussion
|
|
77438
|
+
class="composer"
|
|
77439
|
+
.view=${"composer"}
|
|
77440
|
+
.ticketId=${ticket.id}
|
|
77441
|
+
.draft=${this.commentDraft}
|
|
77126
77442
|
.readOnly=${ticket.permissions?.comment === false}
|
|
77127
77443
|
.searchTickets=${this.searchTickets}
|
|
77444
|
+
.currentPerson=${this.currentPerson}
|
|
77128
77445
|
.addComment=${this.provider.addComment ? this.addComment : void 0}
|
|
77129
|
-
|
|
77130
|
-
|
|
77446
|
+
?hidden=${!!this.provider.loadActivity && this.feed !== "comments"}
|
|
77447
|
+
@kanban-comment-draft=${this.keepCommentDraft}
|
|
77131
77448
|
></dees-kanban-discussion>`;
|
|
77132
77449
|
}
|
|
77133
77450
|
/**
|
|
@@ -77260,6 +77577,7 @@ _ticket = new WeakMap();
|
|
|
77260
77577
|
_tickets2 = new WeakMap();
|
|
77261
77578
|
_columns4 = new WeakMap();
|
|
77262
77579
|
_people = new WeakMap();
|
|
77580
|
+
_currentPerson2 = new WeakMap();
|
|
77263
77581
|
_provider3 = new WeakMap();
|
|
77264
77582
|
_draft4 = new WeakMap();
|
|
77265
77583
|
_commentDraft = new WeakMap();
|
|
@@ -77283,6 +77601,7 @@ __decorateElement(_init106, 4, "ticket", _ticket_dec, _DeesKanbanTicketDetail, _
|
|
|
77283
77601
|
__decorateElement(_init106, 4, "tickets", _tickets_dec2, _DeesKanbanTicketDetail, _tickets2);
|
|
77284
77602
|
__decorateElement(_init106, 4, "columns", _columns_dec4, _DeesKanbanTicketDetail, _columns4);
|
|
77285
77603
|
__decorateElement(_init106, 4, "people", _people_dec, _DeesKanbanTicketDetail, _people);
|
|
77604
|
+
__decorateElement(_init106, 4, "currentPerson", _currentPerson_dec2, _DeesKanbanTicketDetail, _currentPerson2);
|
|
77286
77605
|
__decorateElement(_init106, 4, "provider", _provider_dec3, _DeesKanbanTicketDetail, _provider3);
|
|
77287
77606
|
__decorateElement(_init106, 4, "draft", _draft_dec4, _DeesKanbanTicketDetail, _draft4);
|
|
77288
77607
|
__decorateElement(_init106, 4, "commentDraft", _commentDraft_dec, _DeesKanbanTicketDetail, _commentDraft);
|
|
@@ -77317,6 +77636,11 @@ __publicField(_DeesKanbanTicketDetail, "styles", [
|
|
|
77317
77636
|
* The properties stand between the lead and the rest in the document, so on a phone, where
|
|
77318
77637
|
* they follow the title and the description, the focus order is the order on screen; beside
|
|
77319
77638
|
* the main column they are placed against the panes, outside its scroll.
|
|
77639
|
+
*
|
|
77640
|
+
* The discussion's composer stays at the foot of the main column, over the content scrolling
|
|
77641
|
+
* beneath it, opaque in the detail's surface, --dees-kanban-detail-surface (the page's
|
|
77642
|
+
* background unless the host sets its own). On a short ticket it rests at the bottom, and the
|
|
77643
|
+
* space above it belongs to the conversation. On a phone it follows the discussion.
|
|
77320
77644
|
*/
|
|
77321
77645
|
:host {
|
|
77322
77646
|
display: grid;
|
|
@@ -77332,6 +77656,8 @@ __publicField(_DeesKanbanTicketDetail, "styles", [
|
|
|
77332
77656
|
}
|
|
77333
77657
|
|
|
77334
77658
|
.main {
|
|
77659
|
+
display: flex;
|
|
77660
|
+
flex-direction: column;
|
|
77335
77661
|
height: 100%;
|
|
77336
77662
|
min-width: 0;
|
|
77337
77663
|
margin-right: 280px;
|
|
@@ -77350,11 +77676,31 @@ __publicField(_DeesKanbanTicketDetail, "styles", [
|
|
|
77350
77676
|
min-width: 0;
|
|
77351
77677
|
}
|
|
77352
77678
|
|
|
77679
|
+
/* It takes the height a short ticket leaves, so the composer rests at the bottom. */
|
|
77353
77680
|
.body {
|
|
77681
|
+
flex-grow: 1;
|
|
77354
77682
|
min-width: 0;
|
|
77355
77683
|
margin-top: 24px;
|
|
77356
77684
|
}
|
|
77357
77685
|
|
|
77686
|
+
/*
|
|
77687
|
+
* Across the column and into its bottom padding, so that it meets the column's edges: the
|
|
77688
|
+
* 24px are the column's right and bottom padding.
|
|
77689
|
+
*/
|
|
77690
|
+
.main > .composer {
|
|
77691
|
+
position: sticky;
|
|
77692
|
+
bottom: -24px;
|
|
77693
|
+
z-index: 2;
|
|
77694
|
+
margin: 24px -24px -24px calc(0px - var(--detail-inset-inline, 24px));
|
|
77695
|
+
padding: 16px 24px 16px var(--detail-inset-inline, 24px);
|
|
77696
|
+
border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
77697
|
+
background: var(--dees-kanban-detail-surface, var(--dees-color-bg-primary));
|
|
77698
|
+
}
|
|
77699
|
+
|
|
77700
|
+
.main > .composer[hidden] {
|
|
77701
|
+
display: none;
|
|
77702
|
+
}
|
|
77703
|
+
|
|
77358
77704
|
.toolbar {
|
|
77359
77705
|
flex-wrap: nowrap;
|
|
77360
77706
|
min-width: 0;
|
|
@@ -77871,6 +78217,13 @@ __publicField(_DeesKanbanTicketDetail, "styles", [
|
|
|
77871
78217
|
margin-top: 0;
|
|
77872
78218
|
padding-block: 20px 16px;
|
|
77873
78219
|
}
|
|
78220
|
+
.main > .composer {
|
|
78221
|
+
position: static;
|
|
78222
|
+
margin: 0;
|
|
78223
|
+
padding: 0 var(--detail-inset-inline, 16px) 16px;
|
|
78224
|
+
border-top: 0;
|
|
78225
|
+
background: none;
|
|
78226
|
+
}
|
|
77874
78227
|
/* The band above already sets the discussion apart. */
|
|
77875
78228
|
.body > .discussion:first-child,
|
|
77876
78229
|
.body > .feed:first-child {
|
|
@@ -78084,7 +78437,7 @@ var createKanbanDemo = /* @__PURE__ */ __name((options = {}) => {
|
|
|
78084
78437
|
key: "CAT-102",
|
|
78085
78438
|
kind: "task",
|
|
78086
78439
|
title: "Connect related tickets",
|
|
78087
|
-
description: "Type #
|
|
78440
|
+
description: "Type # in a comment to search for another ticket. Keep the reference connected when its title changes.",
|
|
78088
78441
|
parentId: "epic-2",
|
|
78089
78442
|
columnId: "progress",
|
|
78090
78443
|
order: 0,
|
|
@@ -80361,6 +80714,7 @@ var _DeesKanban = class _DeesKanban extends (_a108 = DeesElement, _heading_dec11
|
|
|
80361
80714
|
this.detail = new DeesKanbanTicketDetail();
|
|
80362
80715
|
this.detail.showTicketKey = false;
|
|
80363
80716
|
this.detail.frameless = true;
|
|
80717
|
+
this.detail.style.setProperty("--dees-kanban-detail-surface", "var(--dees-material-thick-bg-opaque)");
|
|
80364
80718
|
for (const name of interactionEvents) this.detail.addEventListener(name, this.handleInteraction);
|
|
80365
80719
|
}
|
|
80366
80720
|
this.detail.ticket = ticket;
|
|
@@ -80419,6 +80773,7 @@ var _DeesKanban = class _DeesKanban extends (_a108 = DeesElement, _heading_dec11
|
|
|
80419
80773
|
];
|
|
80420
80774
|
this.detail.columns = this.columns;
|
|
80421
80775
|
this.detail.people = this.people;
|
|
80776
|
+
this.detail.currentPerson = this.currentPersonId ? this.people.find((person) => person.id === this.currentPersonId) : void 0;
|
|
80422
80777
|
this.detail.provider = this.provider;
|
|
80423
80778
|
this.detail.searchTickets = this.searchTickets;
|
|
80424
80779
|
this.detail.projects = this.projects;
|
|
@@ -117153,7 +117508,7 @@ var _DeesSimpleAppDash = class _DeesSimpleAppDash extends (_a139 = DeesElement,
|
|
|
117153
117508
|
this.terminalOpen = true;
|
|
117154
117509
|
const request = ++this.terminalRequest;
|
|
117155
117510
|
try {
|
|
117156
|
-
const { DeesWorkspaceTerminal: DeesWorkspaceTerminal3 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-workspace-terminal-
|
|
117511
|
+
const { DeesWorkspaceTerminal: DeesWorkspaceTerminal3 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-workspace-terminal-M3DB4LUI.js");
|
|
117157
117512
|
await this.updateComplete;
|
|
117158
117513
|
if (!this.isConnected || request !== this.terminalRequest) return;
|
|
117159
117514
|
const terminal = new DeesWorkspaceTerminal3();
|
|
@@ -124157,7 +124512,7 @@ var bright = {
|
|
|
124157
124512
|
// ts_web/00_commitinfo_data.ts
|
|
124158
124513
|
var commitinfo = {
|
|
124159
124514
|
name: "@design.estate/dees-catalog",
|
|
124160
|
-
version: "21.
|
|
124515
|
+
version: "21.44.0",
|
|
124161
124516
|
description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
|
|
124162
124517
|
};
|
|
124163
124518
|
export {
|
|
@@ -124443,6 +124798,10 @@ export {
|
|
|
124443
124798
|
docToMarkdown as richtextDocToMarkdown,
|
|
124444
124799
|
richtextMarkdownRenderOptions,
|
|
124445
124800
|
markdownToDoc as richtextMarkdownToDoc,
|
|
124801
|
+
markdownToReferences as richtextMarkdownToReferences,
|
|
124802
|
+
referenceHref as richtextReferenceHref,
|
|
124803
|
+
referenceId as richtextReferenceId,
|
|
124804
|
+
referencesToMarkdown as richtextReferencesToMarkdown,
|
|
124446
124805
|
runAction,
|
|
124447
124806
|
scrollEdgeFadeStyles,
|
|
124448
124807
|
scrollEdgeShadowStyles,
|