@editora/plugins 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/_commonjsHelpers-6763f629.js +1 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +98 -80
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +128 -115
- package/dist/anchoredPopover-33f1358d.mjs +109 -0
- package/dist/anchoredPopover-8151d535.js +1 -0
- package/dist/approval-workflow.cjs.js +447 -0
- package/dist/approval-workflow.esm.js +1111 -0
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +68 -55
- package/dist/blockquote.esm.js +2 -1
- package/dist/blocks-library.cjs.js +442 -0
- package/dist/blocks-library.esm.js +1384 -0
- package/dist/capitalization.esm.js +2 -1
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +82 -58
- package/dist/citations.cjs.js +548 -0
- package/dist/citations.esm.js +1530 -0
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +33 -27
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +93 -82
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +653 -594
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +158 -116
- package/dist/conditional-content.cjs.js +626 -0
- package/dist/conditional-content.esm.js +1421 -0
- package/dist/content-rules.cjs.js +408 -0
- package/dist/content-rules.esm.js +1147 -0
- package/dist/data-binding.cjs.js +321 -0
- package/dist/data-binding.esm.js +953 -0
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +398 -0
- package/dist/doc-schema.esm.js +1378 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +5 -4
- package/dist/documentManager-25b6203c.mjs +9122 -0
- package/dist/documentManager-b69e7054.js +17 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +81 -73
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +77 -65
- package/dist/enterprise.cjs.js +1 -0
- package/dist/enterprise.esm.js +58 -0
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +47 -39
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +53 -37
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +117 -76
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +92 -70
- package/dist/html2canvas.esm-09133e29.js +22 -0
- package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +24 -12
- package/dist/index-656d224b.js +231 -0
- package/dist/index-6a8c48bb.js +1 -0
- package/dist/index-d027b7e2.mjs +16859 -0
- package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-730f2d98.mjs +5775 -0
- package/dist/index.es-dd40173b.js +18 -0
- package/dist/index.esm.js +124 -93
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +9 -8
- package/dist/jspdf.es.min-90db2c97.js +243 -0
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +24 -11
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +30 -24
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +25 -20
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +61 -59
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +146 -139
- package/dist/media-manager.cjs.js +38 -38
- package/dist/media-manager.esm.js +325 -308
- package/dist/mentions.cjs.js +105 -0
- package/dist/mentions.esm.js +774 -0
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +216 -177
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +67 -51
- package/dist/pii-redaction.cjs.js +436 -0
- package/dist/pii-redaction.esm.js +1447 -0
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +37 -32
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +20 -17
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
- package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
- package/dist/slash-commands.cjs.js +90 -0
- package/dist/slash-commands.esm.js +788 -0
- package/dist/smart-paste.cjs.js +398 -0
- package/dist/smart-paste.esm.js +1444 -0
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +69 -61
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +123 -97
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +19 -14
- package/dist/style.css +1 -0
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +225 -191
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +153 -124
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +27 -21
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +87 -70
- package/dist/track-changes.cjs.js +77 -0
- package/dist/track-changes.esm.js +817 -0
- package/dist/translation-workflow.cjs.js +626 -0
- package/dist/translation-workflow.esm.js +1794 -0
- package/dist/version-diff.cjs.js +362 -0
- package/dist/version-diff.esm.js +797 -0
- package/index.d.ts +798 -0
- package/package.json +114 -9
- package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
- package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/documentManager-CTqRftU8.mjs +0 -8369
- package/dist/documentManager-Jf0RbSks.js +0 -17
- package/dist/html2canvas.esm-B5qzocYs.js +0 -5
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-D3CycEFU.mjs +0 -16543
- package/dist/index-tqLTHcO6.js +0 -1
- package/dist/index.es-CE_A4QSm.js +0 -5
- package/dist/index.es-DQ78mYYo.mjs +0 -6665
- package/dist/jspdf.es.min-BoS80556.js +0 -77
- package/dist/plugins.css +0 -1
- /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=".rte-content, .editora-content",q='.rte-conditional-block[data-conditional-content="true"]',b=':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)',f=':is([data-theme="acme"], .editora-theme-acme, .rte-theme-acme)',h=":is(.rte-content.rte-conditional-theme-dark, .editora-content.rte-conditional-theme-dark)",g=":is(.rte-content.rte-conditional-theme-acme, .editora-content.rte-conditional-theme-acme)",Le="rte-conditional-content-styles",c="rte-conditional-dialog-overlay",s="rte-conditional-floating-toolbar",T=new WeakMap,$e=new WeakMap,x=new WeakMap,j=new Map,I=new Map;let ae=null,se=0,G=null,U=null,Y=null,J=null,X=null,Q=null,O=null,y=null,ee=null;const Re={dialogTitleInsert:"Insert Conditional Content",dialogTitleEdit:"Edit Conditional Content",conditionLabel:"Condition",conditionPlaceholder:'user.role == "admin"',audienceLabel:"Audience (comma separated)",audiencePlaceholder:"all",localeLabel:"Locale (comma separated)",localePlaceholder:"all",elseLabel:"Enable Else Block",saveText:"Save",cancelText:"Cancel",blockIfLabel:"IF",blockElseLabel:"ELSE",allAudiencesText:"all audiences",allLocalesText:"all locales"};function $(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function K(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function Ae(e){return!e||e.length===0?"":e.join(", ")}function te(e){return e?e.map(t=>t.trim()).filter(Boolean):[]}function qe(e){return{...Re,...e||{}}}function H(e){return e.getAttribute("contenteditable")==="false"||e.getAttribute("data-readonly")==="true"}function re(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function ue(e){if(!e)return!1;const t=e.getAttribute("data-theme")||e.getAttribute("theme");return t&&t.toLowerCase()==="dark"?!0:e.classList.contains("dark")||e.classList.contains("editora-theme-dark")||e.classList.contains("rte-theme-dark")}function Ke(e){const t=re(e);if(ue(t))return!0;const o=t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");return ue(o)?!0:ue(document.documentElement)||ue(document.body)}function fe(e){if(!e)return!1;const t=e.getAttribute("data-theme")||e.getAttribute("theme");return t&&t.toLowerCase()==="acme"?!0:e.classList.contains("editora-theme-acme")||e.classList.contains("rte-theme-acme")}function _e(e){const t=re(e);if(fe(t))return!0;const o=t.closest("[data-theme], [theme], .editora-theme-acme, .rte-theme-acme");return fe(o)?!0:fe(document.documentElement)||fe(document.body)}function ze(e){return Ke(e)?"dark":_e(e)?"acme":"light"}function he(e,t){const o=ze(t);e.classList.remove("rte-conditional-theme-dark","rte-conditional-theme-acme"),o==="dark"?e.classList.add("rte-conditional-theme-dark"):o==="acme"&&e.classList.add("rte-conditional-theme-acme")}function S(e,t=!0){if((e==null?void 0:e.contentElement)instanceof HTMLElement)return e.contentElement;if((e==null?void 0:e.editorElement)instanceof HTMLElement){const n=e.editorElement;if(n.matches(w))return n;const a=n.querySelector(w);if(a instanceof HTMLElement)return a}const o=window.getSelection();if(o&&o.rangeCount>0){const n=o.getRangeAt(0).startContainer,a=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement,r=a==null?void 0:a.closest(w);if(r)return r}const i=document.activeElement;if(i){if(i.matches(w))return i;const n=i.closest(w);if(n)return n}return y&&y.isConnected?y:t?document.querySelector(w):null}function Se(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const o=t.getRangeAt(0);return e.contains(o.commonAncestorContainer)?o.cloneRange():null}function xe(e,t){const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(t),e.focus({preventScroll:!0}))}function Te(e){e.dispatchEvent(new Event("input",{bubbles:!0}))}function Be(e,t){if(t===e.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,t,e.innerHTML)}catch{}}function pe(e,t){const o=document.createRange();o.selectNodeContents(t),o.collapse(!1),xe(e,o)}function ye(e,t){if(t)return t.split(".").filter(Boolean).reduce((o,i)=>{if(o!=null&&typeof o=="object")return o[i]},e)}function Fe(e){const t=e.trim();if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t==="true")return!0;if(t==="false")return!1;if(t==="null")return null;const o=Number(t);if(!Number.isNaN(o)&&t!=="")return o;if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}"))try{return JSON.parse(t)}catch{return t}return t}function je(e,t){const o=e.trim();if(!o)return!0;if(o.startsWith("!")){const E=o.slice(1).trim();return!ye(t,E)}const i=o.match(/^([a-zA-Z_$][\w.$]*)\s*(==|!=|>=|<=|>|<|in|contains|~=)\s*(.+)$/);if(!i)return!!ye(t,o);const[,n,a,r]=i,l=ye(t,n),d=Fe(r);switch(a){case"==":return l==d;case"!=":return l!=d;case">":return Number(l)>Number(d);case"<":return Number(l)<Number(d);case">=":return Number(l)>=Number(d);case"<=":return Number(l)<=Number(d);case"in":return Array.isArray(d)?d.some(E=>E==l):typeof d=="string"?d.split(",").map(E=>E.trim()).includes(String(l)):!1;case"contains":case"~=":return Array.isArray(l)?l.some(E=>String(E).toLowerCase()===String(d).toLowerCase()):typeof l=="string"?l.toLowerCase().includes(String(d).toLowerCase()):!1;default:return!1}}function Ie(){if(typeof document>"u"||document.getElementById(Le))return;const e=document.createElement("style");e.id=Le,e.textContent=`
|
|
2
|
+
.rte-conditional-block {
|
|
3
|
+
border: 1px solid #dbe3ec;
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
margin: 10px 0;
|
|
6
|
+
background: #f8fafc;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rte-conditional-header,
|
|
11
|
+
.rte-conditional-else-label {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
background: #eef2f7;
|
|
16
|
+
border-bottom: 1px solid #dbe3ec;
|
|
17
|
+
padding: 8px 10px;
|
|
18
|
+
user-select: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rte-conditional-else-label {
|
|
22
|
+
border-top: 1px solid #dbe3ec;
|
|
23
|
+
border-bottom: 1px solid #dbe3ec;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rte-conditional-chip {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
min-width: 34px;
|
|
31
|
+
height: 20px;
|
|
32
|
+
border-radius: 999px;
|
|
33
|
+
border: 1px solid #bfdbfe;
|
|
34
|
+
background: #dbeafe;
|
|
35
|
+
color: #1e3a8a;
|
|
36
|
+
font-size: 11px;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
letter-spacing: 0.03em;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
padding: 0 7px;
|
|
41
|
+
flex: 0 0 auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.rte-conditional-chip-else {
|
|
45
|
+
border-color: #fecaca;
|
|
46
|
+
background: #fee2e2;
|
|
47
|
+
color: #991b1b;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.rte-conditional-summary {
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
color: #0f172a;
|
|
53
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
text-overflow: ellipsis;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
flex: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.rte-conditional-meta {
|
|
61
|
+
font-size: 11px;
|
|
62
|
+
color: #64748b;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
flex: 0 0 auto;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.rte-conditional-body {
|
|
68
|
+
padding: 10px;
|
|
69
|
+
background: #ffffff;
|
|
70
|
+
min-height: 44px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.rte-conditional-hidden {
|
|
74
|
+
display: none !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.rte-toolbar-group-items.conditional-content,
|
|
78
|
+
.editora-toolbar-group-items.conditional-content {
|
|
79
|
+
display: flex;
|
|
80
|
+
border: 1px solid #cbd5e1;
|
|
81
|
+
border-radius: 6px;
|
|
82
|
+
background: #ffffff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.rte-toolbar-group-items.conditional-content .rte-toolbar-item,
|
|
86
|
+
.editora-toolbar-group-items.conditional-content .editora-toolbar-item {
|
|
87
|
+
display: flex;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.rte-toolbar-group-items.conditional-content .rte-toolbar-button,
|
|
91
|
+
.editora-toolbar-group-items.conditional-content .editora-toolbar-button {
|
|
92
|
+
border: none;
|
|
93
|
+
border-right: 1px solid #cbd5e1;
|
|
94
|
+
border-radius: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.rte-toolbar-group-items.conditional-content .rte-toolbar-item:last-child .rte-toolbar-button,
|
|
98
|
+
.editora-toolbar-group-items.conditional-content .editora-toolbar-item:last-child .editora-toolbar-button {
|
|
99
|
+
border-right: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.rte-toolbar-button[data-command="toggleConditionalPreview"].active,
|
|
103
|
+
.editora-toolbar-button[data-command="toggleConditionalPreview"].active {
|
|
104
|
+
background: #ccc;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.rte-conditional-block.rte-conditional-preview {
|
|
108
|
+
border-style: dashed;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.rte-conditional-block.rte-conditional-preview .rte-conditional-body[contenteditable="false"] {
|
|
112
|
+
cursor: default;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.${c} {
|
|
116
|
+
position: fixed;
|
|
117
|
+
inset: 0;
|
|
118
|
+
background: rgba(15, 23, 42, 0.5);
|
|
119
|
+
z-index: 2147483646;
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
padding: 20px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.rte-conditional-dialog {
|
|
127
|
+
width: min(560px, 96vw);
|
|
128
|
+
max-height: min(88vh, 760px);
|
|
129
|
+
border: 1px solid #dbe3ec;
|
|
130
|
+
border-radius: 8px;
|
|
131
|
+
background: #ffffff;
|
|
132
|
+
box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.rte-conditional-dialog-header,
|
|
139
|
+
.rte-conditional-dialog-footer {
|
|
140
|
+
padding: 12px 14px;
|
|
141
|
+
border-bottom: 1px solid #e2e8f0;
|
|
142
|
+
background: #f8fafc;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
gap: 10px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.rte-conditional-dialog-footer {
|
|
150
|
+
border-top: 1px solid #e2e8f0;
|
|
151
|
+
border-bottom: none;
|
|
152
|
+
justify-content: flex-end;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rte-conditional-dialog-title {
|
|
156
|
+
margin: 0;
|
|
157
|
+
font-size: 16px;
|
|
158
|
+
font-weight: 700;
|
|
159
|
+
color: #0f172a;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.rte-conditional-dialog-body {
|
|
163
|
+
padding: 14px;
|
|
164
|
+
overflow: auto;
|
|
165
|
+
display: grid;
|
|
166
|
+
grid-template-columns: 1fr;
|
|
167
|
+
gap: 12px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.rte-conditional-field {
|
|
171
|
+
display: grid;
|
|
172
|
+
gap: 6px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.rte-conditional-field label {
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
font-weight: 600;
|
|
178
|
+
color: #334155;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.rte-conditional-field input[type="text"] {
|
|
182
|
+
width: 100%;
|
|
183
|
+
min-height: 36px;
|
|
184
|
+
border: 1px solid #cbd5e1;
|
|
185
|
+
border-radius: 6px;
|
|
186
|
+
padding: 8px 10px;
|
|
187
|
+
font-size: 13px;
|
|
188
|
+
line-height: 1.4;
|
|
189
|
+
box-sizing: border-box;
|
|
190
|
+
color: #0f172a;
|
|
191
|
+
background: #ffffff;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.rte-conditional-field input[type="text"]:focus-visible,
|
|
195
|
+
.rte-conditional-btn:focus-visible {
|
|
196
|
+
outline: none;
|
|
197
|
+
border-color: #3b82f6;
|
|
198
|
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.rte-conditional-checkbox {
|
|
202
|
+
display: inline-flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
gap: 8px;
|
|
205
|
+
font-size: 13px;
|
|
206
|
+
color: #334155;
|
|
207
|
+
min-height: 36px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.rte-conditional-help {
|
|
211
|
+
margin: 0;
|
|
212
|
+
font-size: 12px;
|
|
213
|
+
color: #64748b;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.rte-conditional-btn {
|
|
217
|
+
border: 1px solid #cbd5e1;
|
|
218
|
+
border-radius: 6px;
|
|
219
|
+
min-height: 34px;
|
|
220
|
+
padding: 6px 12px;
|
|
221
|
+
background: #ffffff;
|
|
222
|
+
color: #0f172a;
|
|
223
|
+
font-size: 13px;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.rte-conditional-btn-primary {
|
|
228
|
+
border-color: #2563eb;
|
|
229
|
+
background: #2563eb;
|
|
230
|
+
color: #ffffff;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.rte-conditional-btn-primary:hover {
|
|
234
|
+
background: #1d4ed8;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.${s} {
|
|
238
|
+
position: fixed;
|
|
239
|
+
z-index: 2147483645;
|
|
240
|
+
display: none;
|
|
241
|
+
align-items: center;
|
|
242
|
+
gap: 6px;
|
|
243
|
+
padding: 6px;
|
|
244
|
+
border-radius: 8px;
|
|
245
|
+
border: 1px solid #cbd5e1;
|
|
246
|
+
background: rgba(255, 255, 255, 0.98);
|
|
247
|
+
box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
|
|
248
|
+
backdrop-filter: blur(6px);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.${s}.show {
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.${s} .rte-conditional-float-btn {
|
|
256
|
+
border: 1px solid #cbd5e1;
|
|
257
|
+
border-radius: 6px;
|
|
258
|
+
min-height: 30px;
|
|
259
|
+
min-width: 30px;
|
|
260
|
+
padding: 0 8px;
|
|
261
|
+
display: inline-flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
justify-content: center;
|
|
264
|
+
gap: 6px;
|
|
265
|
+
background: #ffffff;
|
|
266
|
+
color: #0f172a;
|
|
267
|
+
cursor: pointer;
|
|
268
|
+
font-size: 12px;
|
|
269
|
+
line-height: 1;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.${s} .rte-conditional-float-btn:hover {
|
|
273
|
+
background: #f8fafc;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.${s} .rte-conditional-float-btn[data-action="delete"] {
|
|
277
|
+
border-color: #fecaca;
|
|
278
|
+
color: #991b1b;
|
|
279
|
+
background: #fff5f5;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.rte-conditional-preview-on ${q} {
|
|
283
|
+
border-width: 2px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.rte-conditional-preview-on ${q} .rte-conditional-header {
|
|
287
|
+
background: #ecfeff;
|
|
288
|
+
border-color: #bae6fd;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
${b} .rte-conditional-block,
|
|
292
|
+
${h} .rte-conditional-block,
|
|
293
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-block {
|
|
294
|
+
background: #111827;
|
|
295
|
+
border-color: #334155;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
${b} .rte-conditional-header,
|
|
299
|
+
${b} .rte-conditional-else-label,
|
|
300
|
+
${h} .rte-conditional-header,
|
|
301
|
+
${h} .rte-conditional-else-label,
|
|
302
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-header,
|
|
303
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-else-label {
|
|
304
|
+
background: #0f172a;
|
|
305
|
+
border-color: #334155;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
${b} .rte-conditional-summary,
|
|
309
|
+
${h} .rte-conditional-summary,
|
|
310
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-summary {
|
|
311
|
+
color: #e2e8f0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
${b} .rte-conditional-meta,
|
|
315
|
+
${h} .rte-conditional-meta,
|
|
316
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-meta {
|
|
317
|
+
color: #94a3b8;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
${b} .rte-conditional-chip,
|
|
321
|
+
${h} .rte-conditional-chip,
|
|
322
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-chip {
|
|
323
|
+
background: #1e3a8a;
|
|
324
|
+
border-color: #3b82f6;
|
|
325
|
+
color: #dbeafe;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
${b} .rte-conditional-chip-else,
|
|
329
|
+
${h} .rte-conditional-chip-else,
|
|
330
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-chip-else {
|
|
331
|
+
background: #7f1d1d;
|
|
332
|
+
border-color: #ef4444;
|
|
333
|
+
color: #fee2e2;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
${b} .rte-conditional-body,
|
|
337
|
+
${h} .rte-conditional-body,
|
|
338
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-body {
|
|
339
|
+
background: #1f2937;
|
|
340
|
+
color: #e2e8f0;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
${b} .rte-conditional-dialog,
|
|
344
|
+
${h} .rte-conditional-dialog,
|
|
345
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-dialog {
|
|
346
|
+
background: #1f2937;
|
|
347
|
+
border-color: #334155;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
${b} .rte-conditional-dialog-header,
|
|
351
|
+
${b} .rte-conditional-dialog-footer,
|
|
352
|
+
${h} .rte-conditional-dialog-header,
|
|
353
|
+
${h} .rte-conditional-dialog-footer,
|
|
354
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-dialog-header,
|
|
355
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-dialog-footer {
|
|
356
|
+
background: #111827;
|
|
357
|
+
border-color: #334155;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
${b} .rte-conditional-dialog-title,
|
|
361
|
+
${b} .rte-conditional-field label,
|
|
362
|
+
${b} .rte-conditional-checkbox,
|
|
363
|
+
${h} .rte-conditional-dialog-title,
|
|
364
|
+
${h} .rte-conditional-field label,
|
|
365
|
+
${h} .rte-conditional-checkbox,
|
|
366
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-dialog-title,
|
|
367
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-field label,
|
|
368
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-checkbox {
|
|
369
|
+
color: #e2e8f0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
${b} .rte-conditional-help,
|
|
373
|
+
${h} .rte-conditional-help,
|
|
374
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-help {
|
|
375
|
+
color: #94a3b8;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
${b} .rte-conditional-field input[type="text"],
|
|
379
|
+
${b} .rte-conditional-btn,
|
|
380
|
+
${h} .rte-conditional-field input[type="text"],
|
|
381
|
+
${h} .rte-conditional-btn,
|
|
382
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-field input[type="text"],
|
|
383
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-btn {
|
|
384
|
+
background: #0f172a;
|
|
385
|
+
border-color: #475569;
|
|
386
|
+
color: #e2e8f0;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
${b} .rte-conditional-btn-primary,
|
|
390
|
+
${h} .rte-conditional-btn-primary,
|
|
391
|
+
.${c}.rte-conditional-theme-dark .rte-conditional-btn-primary {
|
|
392
|
+
border-color: #3b82f6;
|
|
393
|
+
background: #2563eb;
|
|
394
|
+
color: #ffffff;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
${b} .rte-toolbar-group-items.conditional-content,
|
|
398
|
+
.${c}.rte-conditional-theme-dark .rte-toolbar-group-items.conditional-content,
|
|
399
|
+
${h} .rte-toolbar-group-items.conditional-content,
|
|
400
|
+
${b} .editora-toolbar-group-items.conditional-content {
|
|
401
|
+
border-color: #566275;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
${b} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
|
|
405
|
+
${h} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
|
|
406
|
+
${b} .editora-toolbar-group-items.conditional-content .editora-toolbar-button {
|
|
407
|
+
border-right-color: #566275;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
${b} .${s},
|
|
411
|
+
.${c}.rte-conditional-theme-dark .${s},
|
|
412
|
+
.${s}.rte-conditional-theme-dark {
|
|
413
|
+
background: rgba(17, 24, 39, 0.98);
|
|
414
|
+
border-color: #334155;
|
|
415
|
+
box-shadow: 0 14px 30px rgba(2, 6, 23, 0.5);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
${b} .${s} .rte-conditional-float-btn,
|
|
419
|
+
.${c}.rte-conditional-theme-dark .${s} .rte-conditional-float-btn,
|
|
420
|
+
.${s}.rte-conditional-theme-dark .rte-conditional-float-btn {
|
|
421
|
+
background: #0f172a;
|
|
422
|
+
border-color: #475569;
|
|
423
|
+
color: #e2e8f0;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
${b} .${s} .rte-conditional-float-btn[data-action="delete"],
|
|
427
|
+
.${c}.rte-conditional-theme-dark .${s} .rte-conditional-float-btn[data-action="delete"],
|
|
428
|
+
.${s}.rte-conditional-theme-dark .rte-conditional-float-btn[data-action="delete"] {
|
|
429
|
+
border-color: #ef4444;
|
|
430
|
+
color: #fecaca;
|
|
431
|
+
background: rgba(127, 29, 29, 0.45);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
${f} .rte-conditional-block,
|
|
435
|
+
${g} .rte-conditional-block,
|
|
436
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-block {
|
|
437
|
+
background: #f8fbff;
|
|
438
|
+
border-color: #cbd8e8;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
${f} .rte-conditional-header,
|
|
442
|
+
${f} .rte-conditional-else-label,
|
|
443
|
+
${g} .rte-conditional-header,
|
|
444
|
+
${g} .rte-conditional-else-label,
|
|
445
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-header,
|
|
446
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-else-label {
|
|
447
|
+
background: linear-gradient(180deg, #eef4fb 0%, #e6eef8 100%);
|
|
448
|
+
border-color: #cbd8e8;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
${f} .rte-conditional-summary,
|
|
452
|
+
${g} .rte-conditional-summary,
|
|
453
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-summary {
|
|
454
|
+
color: #0f172a;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
${f} .rte-conditional-meta,
|
|
458
|
+
${g} .rte-conditional-meta,
|
|
459
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-meta {
|
|
460
|
+
color: #587089;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
${f} .rte-conditional-chip,
|
|
464
|
+
${g} .rte-conditional-chip,
|
|
465
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-chip {
|
|
466
|
+
background: #d9f5ee;
|
|
467
|
+
border-color: #66c6b3;
|
|
468
|
+
color: #0f4f4a;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
${f} .rte-conditional-chip-else,
|
|
472
|
+
${g} .rte-conditional-chip-else,
|
|
473
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-chip-else {
|
|
474
|
+
background: #fde8ea;
|
|
475
|
+
border-color: #f1a7b2;
|
|
476
|
+
color: #8b1f2f;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
${f} .rte-conditional-body,
|
|
480
|
+
${g} .rte-conditional-body,
|
|
481
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-body {
|
|
482
|
+
background: #fcfeff;
|
|
483
|
+
color: #0f172a;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
${f} .rte-conditional-dialog,
|
|
487
|
+
${g} .rte-conditional-dialog,
|
|
488
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-dialog {
|
|
489
|
+
background: #ffffff;
|
|
490
|
+
border-color: #cbd8e8;
|
|
491
|
+
box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
${f} .rte-conditional-dialog-header,
|
|
495
|
+
${f} .rte-conditional-dialog-footer,
|
|
496
|
+
${g} .rte-conditional-dialog-header,
|
|
497
|
+
${g} .rte-conditional-dialog-footer,
|
|
498
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-dialog-header,
|
|
499
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-dialog-footer {
|
|
500
|
+
background: #f3f8fd;
|
|
501
|
+
border-color: #d8e4f1;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
${f} .rte-conditional-dialog-title,
|
|
505
|
+
${f} .rte-conditional-field label,
|
|
506
|
+
${f} .rte-conditional-checkbox,
|
|
507
|
+
${g} .rte-conditional-dialog-title,
|
|
508
|
+
${g} .rte-conditional-field label,
|
|
509
|
+
${g} .rte-conditional-checkbox,
|
|
510
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-dialog-title,
|
|
511
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-field label,
|
|
512
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-checkbox {
|
|
513
|
+
color: #1f334a;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
${f} .rte-conditional-help,
|
|
517
|
+
${g} .rte-conditional-help,
|
|
518
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-help {
|
|
519
|
+
color: #5f738d;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
${f} .rte-conditional-field input[type="text"],
|
|
523
|
+
${f} .rte-conditional-btn,
|
|
524
|
+
${g} .rte-conditional-field input[type="text"],
|
|
525
|
+
${g} .rte-conditional-btn,
|
|
526
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-field input[type="text"],
|
|
527
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-btn {
|
|
528
|
+
background: #ffffff;
|
|
529
|
+
border-color: #bfd0e2;
|
|
530
|
+
color: #0f172a;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
${f} .rte-conditional-btn-primary,
|
|
534
|
+
${g} .rte-conditional-btn-primary,
|
|
535
|
+
.${c}.rte-conditional-theme-acme .rte-conditional-btn-primary {
|
|
536
|
+
border-color: #0f766e;
|
|
537
|
+
background: #0f766e;
|
|
538
|
+
color: #ffffff;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
${f} .rte-toolbar-group-items.conditional-content,
|
|
542
|
+
.${c}.rte-conditional-theme-acme .rte-toolbar-group-items.conditional-content,
|
|
543
|
+
${g} .rte-toolbar-group-items.conditional-content,
|
|
544
|
+
${f} .editora-toolbar-group-items.conditional-content {
|
|
545
|
+
border-color: #bfd0e2;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
${f} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
|
|
549
|
+
${g} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
|
|
550
|
+
${f} .editora-toolbar-group-items.conditional-content .editora-toolbar-button {
|
|
551
|
+
border-right-color: #bfd0e2;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
${f} .${s},
|
|
555
|
+
.${c}.rte-conditional-theme-acme .${s},
|
|
556
|
+
.${s}.rte-conditional-theme-acme {
|
|
557
|
+
background: rgba(255, 255, 255, 0.98);
|
|
558
|
+
border-color: #bfd0e2;
|
|
559
|
+
box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
${f} .${s} .rte-conditional-float-btn,
|
|
563
|
+
.${c}.rte-conditional-theme-acme .${s} .rte-conditional-float-btn,
|
|
564
|
+
.${s}.rte-conditional-theme-acme .rte-conditional-float-btn {
|
|
565
|
+
background: #ffffff;
|
|
566
|
+
border-color: #bfd0e2;
|
|
567
|
+
color: #1f334a;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
${f} .${s} .rte-conditional-float-btn:hover,
|
|
571
|
+
.${c}.rte-conditional-theme-acme .${s} .rte-conditional-float-btn:hover,
|
|
572
|
+
.${s}.rte-conditional-theme-acme .rte-conditional-float-btn:hover {
|
|
573
|
+
background: #eef7f5;
|
|
574
|
+
color: #0f4f4a;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
${f} .${s} .rte-conditional-float-btn[data-action="delete"],
|
|
578
|
+
.${c}.rte-conditional-theme-acme .${s} .rte-conditional-float-btn[data-action="delete"],
|
|
579
|
+
.${s}.rte-conditional-theme-acme .rte-conditional-float-btn[data-action="delete"] {
|
|
580
|
+
border-color: #f1a7b2;
|
|
581
|
+
color: #8b1f2f;
|
|
582
|
+
background: #fff4f6;
|
|
583
|
+
}
|
|
584
|
+
`,document.head.appendChild(e)}function Ve(e){return{defaultCondition:e.defaultCondition||"",defaultAudience:te(e.defaultAudience||[]),defaultLocale:te(e.defaultLocale||[]),enableElseByDefault:e.enableElseByDefault===!0,labels:qe(e.labels),context:e.context,getContext:e.getContext,currentAudience:e.currentAudience,currentLocale:e.currentLocale,evaluateCondition:e.evaluateCondition||je}}function Me(){ae&&(ae.cleanup(),ae=null)}function We(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function oe(e,t){e.setAttribute("contenteditable","false"),e.setAttribute("spellcheck","false");const o=e.querySelector(".rte-conditional-header");o&&(o.setAttribute("contenteditable","false"),o.setAttribute("tabindex","0"),o.setAttribute("role","button"),o.setAttribute("aria-label","Edit conditional rule"));const i=e.querySelector(".rte-conditional-else-label");i&&i.setAttribute("contenteditable","false"),Ue(e,!t)}function Ze(e){const t=e.querySelector('.rte-conditional-body[data-slot="if"]');if(!t)return;const o=new Set,i=e.querySelector(".rte-conditional-header"),n=e.querySelector(".rte-conditional-else-label"),a=e.querySelector('.rte-conditional-body[data-slot="else"]');i&&o.add(i),o.add(t),n&&o.add(n),a&&o.add(a),Array.from(e.childNodes).forEach(l=>{if(!(l instanceof HTMLElement&&o.has(l))){if(l.nodeType===Node.TEXT_NODE&&!(l.textContent||"").trim()){l.remove();return}t.appendChild(l)}})}function W(e){const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0).startContainer,a=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement,r=a==null?void 0:a.closest(q);if(r&&e.contains(r))return r}const o=document.activeElement,i=o==null?void 0:o.closest(q);return i&&e.contains(i)?i:null}function Ee(e,t){let o=e.querySelector(".rte-conditional-else-label"),i=e.querySelector('.rte-conditional-body[data-slot="else"]');o||(o=document.createElement("div"),o.className="rte-conditional-else-label",o.setAttribute("contenteditable","false"),o.innerHTML=`
|
|
585
|
+
<span class="rte-conditional-chip rte-conditional-chip-else">${$(t.blockElseLabel)}</span>
|
|
586
|
+
<span class="rte-conditional-summary">Else branch</span>
|
|
587
|
+
`,e.appendChild(o)),i||(i=document.createElement("div"),i.className="rte-conditional-body rte-conditional-else-body",i.setAttribute("data-slot","else"),i.innerHTML="<p><br></p>",e.appendChild(i))}function Ge(e,t){e.setAttribute("data-has-else",t?"true":"false");const o=e.querySelector(".rte-conditional-else-label"),i=e.querySelector('.rte-conditional-body[data-slot="else"]');o&&o.classList.toggle("rte-conditional-hidden",!t),i&&i.classList.toggle("rte-conditional-hidden",!t)}function Ue(e,t){Array.from(e.querySelectorAll(".rte-conditional-body")).forEach(i=>{i.setAttribute("contenteditable",t?"true":"false")}),e.setAttribute("contenteditable","false")}function ve(e,t){const o=e.getAttribute("data-condition")||"",i=K(e.getAttribute("data-audience")),n=K(e.getAttribute("data-locale"));let a=e.querySelector(".rte-conditional-header");a||(a=document.createElement("div"),a.className="rte-conditional-header",e.prepend(a)),a.setAttribute("contenteditable","false"),a.setAttribute("tabindex","0"),a.setAttribute("role","button"),a.setAttribute("aria-label","Edit conditional rule");const r=o||"(always true)",l=i.length>0?i.join(", "):t.allAudiencesText,d=n.length>0?n.join(", "):t.allLocalesText;if(a.innerHTML=`
|
|
588
|
+
<span class="rte-conditional-chip">${$(t.blockIfLabel)}</span>
|
|
589
|
+
<span class="rte-conditional-summary">${$(r)}</span>
|
|
590
|
+
<span class="rte-conditional-meta">${$(l)} · ${$(d)}</span>
|
|
591
|
+
`,!e.querySelector('.rte-conditional-body[data-slot="if"]')){const p=document.createElement("div");p.className="rte-conditional-body",p.setAttribute("data-slot","if"),p.innerHTML="<p><br></p>",e.insertBefore(p,e.children[1]||null)}const L=e.getAttribute("data-has-else")==="true";L&&Ee(e,t),Ze(e),Ge(e,L)}function Ne(e,t){const o=document.createElement("section");o.className="rte-conditional-block",o.setAttribute("data-conditional-content","true"),o.setAttribute("data-condition",(e.condition||"").trim()),o.setAttribute("data-audience",te(e.audience).join(",")),o.setAttribute("data-locale",te(e.locale).join(",")),o.setAttribute("data-has-else",e.hasElse?"true":"false"),o.setAttribute("role","group"),o.setAttribute("aria-label","Conditional content block"),o.setAttribute("contenteditable","false"),o.setAttribute("spellcheck","false");const i=document.createElement("div");i.className="rte-conditional-header",i.setAttribute("contenteditable","false");const n=document.createElement("div");return n.className="rte-conditional-body",n.setAttribute("data-slot","if"),n.innerHTML="<p><br></p>",o.appendChild(i),o.appendChild(n),e.hasElse&&Ee(o,t),ve(o,t),oe(o,!1),o}function Ye(e,t){if(t)try{if(!e.isConnected)return;const o=e.contains(t.startContainer),i=e.contains(t.endContainer);if(!o||!i)return;xe(e,t)}catch{}}function Je(e){return(e.textContent||"").replace(/\u200B/g,"").trim().length>0?!0:e.querySelector("img, video, table, iframe, hr, pre, blockquote, ul, ol")!==null}function De(e,t,o){let i=null;if(o)try{const r=o.cloneRange();e.contains(r.commonAncestorContainer)&&(i=r)}catch{i=null}i||(i=Se(e)),i||(i=document.createRange(),i.selectNodeContents(e),i.collapse(!1));let n=null;i.collapsed||(n=i.extractContents()),i.insertNode(t);const a=t.querySelector('.rte-conditional-body[data-slot="if"]');a&&n&&Je(n)&&(a.innerHTML="",a.appendChild(n)),a?pe(e,a):pe(e,t),e.normalize()}function Xe(e){return{condition:e.getAttribute("data-condition")||"",audience:K(e.getAttribute("data-audience")),locale:K(e.getAttribute("data-locale")),hasElse:e.getAttribute("data-has-else")==="true"}}function Qe(e,t,o){e.setAttribute("data-condition",(t.condition||"").trim()),e.setAttribute("data-audience",te(t.audience).join(",")),e.setAttribute("data-locale",te(t.locale).join(",")),e.setAttribute("data-has-else",t.hasElse?"true":"false"),t.hasElse&&Ee(e,o),ve(e,o),oe(e,e.classList.contains("rte-conditional-preview"))}function ne(e,t){he(e,e);const o=Array.from(e.querySelectorAll(q)),i=T.get(e)===!0;return o.forEach(n=>{n.classList.add("rte-conditional-block"),n.setAttribute("data-conditional-content","true"),n.hasAttribute("data-condition")||n.setAttribute("data-condition",""),n.hasAttribute("data-audience")||n.setAttribute("data-audience",""),n.hasAttribute("data-locale")||n.setAttribute("data-locale",""),n.hasAttribute("data-has-else")||n.setAttribute("data-has-else","false"),n.setAttribute("role","group"),n.setAttribute("aria-label","Conditional content block"),n.setAttribute("contenteditable","false"),n.setAttribute("spellcheck","false"),ve(n,t),oe(n,i)}),o}async function et(e,t){const o=$e.get(e);if(o)return o;if(typeof t.getContext=="function")try{const i=re(e),n=await Promise.resolve(t.getContext({editor:e,editorRoot:i}));if(n&&typeof n=="object")return n}catch{return{}}if(typeof t.context=="function")try{const i=t.context();if(i&&typeof i=="object")return i}catch{return{}}return t.context&&typeof t.context=="object"?t.context:{}}function be(e){return Array.isArray(e)?e.map(t=>t.trim().toLowerCase()).filter(Boolean):typeof e=="string"?e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean):[]}function we(e,t){return e.length===0||e.includes("all")?!0:t.length===0?!1:e.some(o=>t.includes(o))}async function Z(e,t,o){var M,le;const i=t.labels,n=ne(e,i);if(T.set(e,o),He(e,o),re(e).classList.toggle("rte-conditional-preview-on",o),!o){n.forEach(m=>{m.classList.remove("rte-conditional-preview"),oe(m,!1);const N=m.querySelector('.rte-conditional-body[data-slot="if"]'),D=m.querySelector('.rte-conditional-body[data-slot="else"]'),P=m.querySelector(".rte-conditional-else-label"),C=m.getAttribute("data-has-else")==="true";N&&(N.classList.remove("rte-conditional-hidden"),N.removeAttribute("aria-hidden")),D&&(D.classList.toggle("rte-conditional-hidden",!C),D.setAttribute("aria-hidden",C?"false":"true")),P&&P.classList.toggle("rte-conditional-hidden",!C)});return}const r=await et(e,t),l=be(t.currentAudience),d=be(t.currentLocale),E=be(r.audience??((M=r.user)==null?void 0:M.audience)),L=be(r.locale??((le=r.user)==null?void 0:le.locale)),p=l.length>0?l:E,B=d.length>0?d:L;n.forEach(m=>{const N=m.getAttribute("data-condition")||"",D=K(m.getAttribute("data-audience")).map(v=>v.toLowerCase()),P=K(m.getAttribute("data-locale")).map(v=>v.toLowerCase()),C=m.getAttribute("data-has-else")==="true",ce=t.evaluateCondition(N,r),de=we(D,p),ge=we(P,B),_=ce&&de&&ge,V=m.querySelector('.rte-conditional-body[data-slot="if"]'),u=m.querySelector('.rte-conditional-body[data-slot="else"]'),k=m.querySelector(".rte-conditional-else-label");if(m.classList.add("rte-conditional-preview"),oe(m,!0),V&&(V.classList.toggle("rte-conditional-hidden",!_),V.setAttribute("aria-hidden",_?"false":"true")),u){const v=C&&!_;u.classList.toggle("rte-conditional-hidden",!v),u.setAttribute("aria-hidden",v?"false":"true")}if(k){const v=C&&!_;k.classList.toggle("rte-conditional-hidden",!v)}})}function He(e,t){const o=re(e);Array.from(o.querySelectorAll('[data-command="toggleConditionalPreview"], [data-command="conditionalPreview"]')).forEach(n=>{n.setAttribute("data-active",t?"true":"false"),n.classList.toggle("active",t),n.setAttribute("aria-pressed",t?"true":"false")})}function tt(e){const t=j.get(e);if(t&&t.isConnected)return t;const o=document.createElement("div");return o.className=s,o.setAttribute("role","toolbar"),o.setAttribute("aria-label","Conditional block actions"),o.innerHTML=`
|
|
592
|
+
<button type="button" class="rte-conditional-float-btn" data-action="edit" title="Edit Condition" aria-label="Edit Condition">
|
|
593
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M4 17.3V20h2.7l9.7-9.7-2.7-2.7L4 17.3Zm14.7-9.4a1 1 0 0 0 0-1.4l-1.2-1.2a1 1 0 0 0-1.4 0l-1.1 1.1 2.7 2.7 1-1.2Z" fill="currentColor"></path></svg>
|
|
594
|
+
</button>
|
|
595
|
+
<button type="button" class="rte-conditional-float-btn" data-action="delete" title="Delete Block" aria-label="Delete Block">
|
|
596
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M8 4h8l1 2h4v2H3V6h4l1-2Zm1 6h2v8H9v-8Zm4 0h2v8h-2v-8Z" fill="currentColor"></path></svg>
|
|
597
|
+
</button>
|
|
598
|
+
`,o.addEventListener("mousedown",i=>{i.preventDefault()}),o.addEventListener("click",i=>{var d;const n=i.target,a=(d=n==null?void 0:n.closest("[data-action]"))==null?void 0:d.getAttribute("data-action");if(!a)return;const r=x.get(e)||ee;if(!r)return;const l=I.get(e);if(!(!l||!e.contains(l))){if(a==="edit"){A(e,r,"edit",void 0,l);return}a==="delete"&&(Oe(e,l),I.set(e,null),F(e))}}),document.body.appendChild(o),j.set(e,o),o}function F(e){const t=j.get(e);t&&t.classList.remove("show")}function Pe(e,t){const o=t.getBoundingClientRect();e.style.left="0px",e.style.top="0px",e.classList.add("show");const i=e.getBoundingClientRect(),n=8,a=window.innerWidth,r=window.innerHeight;let l=o.top-i.height-n;l<n&&(l=o.bottom+n),l=Math.min(l,r-i.height-n);let d=o.right-i.width;d=Math.max(n,Math.min(d,a-i.width-n)),e.style.left=`${d}px`,e.style.top=`${l}px`}function me(e,t){const o=tt(e);he(o,e),I.set(e,t),Pe(o,t)}function R(e){const t=x.get(e)||ee;if(!t)return;const o=W(e);if(!o||!e.contains(o)||H(e)){I.set(e,null),F(e);return}ne(e,t.labels),me(e,o)}function ot(){j.forEach((e,t)=>{if(!t.isConnected||!e.isConnected){e.remove(),j.delete(t),I.delete(t);return}if(!e.classList.contains("show"))return;he(e,t);const o=I.get(t);if(!o||!t.contains(o)){F(t);return}Pe(e,o)})}function Oe(e,t){if(!e.contains(t))return!1;const o=e.innerHTML,i=t.parentNode,n=t.nextSibling;t.remove(),i===e&&e.innerHTML.trim()===""&&(e.innerHTML="<p><br></p>");const a=document.createRange();return n&&e.contains(n)?a.setStartBefore(n):(a.selectNodeContents(e),a.collapse(!1)),a.collapse(!0),xe(e,a),Te(e),Be(e,o),!0}function ke(e,t,o){const i=e.cloneRange(),n=document.createRange();return n.selectNodeContents(t),n.collapse(o==="start"),i.startContainer===n.startContainer&&i.startOffset===n.startOffset&&i.endContainer===n.endContainer&&i.endOffset===n.endOffset}function A(e,t,o,i,n){Me();const a=t.labels,r=o==="insert"?Se(e):null,l=document.createElement("div");l.className=c,he(l,e);const d=document.createElement("section");d.className="rte-conditional-dialog",d.setAttribute("role","dialog"),d.setAttribute("aria-modal","true"),d.setAttribute("aria-labelledby","rte-conditional-dialog-title");const E=n?Xe(n):void 0,L=i||E||{},p=L.condition??t.defaultCondition,B=L.audience??t.defaultAudience,M=L.locale??t.defaultLocale,le=L.hasElse??t.enableElseByDefault;d.innerHTML=`
|
|
599
|
+
<header class="rte-conditional-dialog-header">
|
|
600
|
+
<h2 id="rte-conditional-dialog-title" class="rte-conditional-dialog-title">${$(o==="edit"?a.dialogTitleEdit:a.dialogTitleInsert)}</h2>
|
|
601
|
+
<button type="button" class="rte-conditional-btn" data-action="cancel" aria-label="${$(a.cancelText)}">✕</button>
|
|
602
|
+
</header>
|
|
603
|
+
<div class="rte-conditional-dialog-body">
|
|
604
|
+
<div class="rte-conditional-field">
|
|
605
|
+
<label for="rte-conditional-condition">${$(a.conditionLabel)}</label>
|
|
606
|
+
<input id="rte-conditional-condition" class="rte-conditional-input-condition" type="text" value="${$(p||"")}" placeholder="${$(a.conditionPlaceholder)}" />
|
|
607
|
+
</div>
|
|
608
|
+
<div class="rte-conditional-field">
|
|
609
|
+
<label for="rte-conditional-audience">${$(a.audienceLabel)}</label>
|
|
610
|
+
<input id="rte-conditional-audience" class="rte-conditional-input-audience" type="text" value="${$(Ae(B))}" placeholder="${$(a.audiencePlaceholder)}" />
|
|
611
|
+
</div>
|
|
612
|
+
<div class="rte-conditional-field">
|
|
613
|
+
<label for="rte-conditional-locale">${$(a.localeLabel)}</label>
|
|
614
|
+
<input id="rte-conditional-locale" class="rte-conditional-input-locale" type="text" value="${$(Ae(M))}" placeholder="${$(a.localePlaceholder)}" />
|
|
615
|
+
</div>
|
|
616
|
+
<label class="rte-conditional-checkbox">
|
|
617
|
+
<input class="rte-conditional-input-else" type="checkbox" ${le?"checked":""} />
|
|
618
|
+
<span>${$(a.elseLabel)}</span>
|
|
619
|
+
</label>
|
|
620
|
+
<p class="rte-conditional-help">Example condition: <code>user.role == "admin"</code>, <code>locale == "en-US"</code>, <code>!feature.beta</code></p>
|
|
621
|
+
</div>
|
|
622
|
+
<footer class="rte-conditional-dialog-footer">
|
|
623
|
+
<button type="button" class="rte-conditional-btn" data-action="cancel">${$(a.cancelText)}</button>
|
|
624
|
+
<button type="button" class="rte-conditional-btn rte-conditional-btn-primary" data-action="save">${$(a.saveText)}</button>
|
|
625
|
+
</footer>
|
|
626
|
+
`,l.appendChild(d),document.body.appendChild(l);const m=d.querySelector(".rte-conditional-input-condition"),N=d.querySelector(".rte-conditional-input-audience"),D=d.querySelector(".rte-conditional-input-locale"),P=d.querySelector(".rte-conditional-input-else"),C=()=>{l.removeEventListener("click",de),l.removeEventListener("keydown",V,!0),document.removeEventListener("keydown",ce,!0),l.parentNode&&l.parentNode.removeChild(l),ae=null,e.focus({preventScroll:!0}),R(e)},ce=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),C())},de=u=>{u.target===l&&C()},ge=u=>{if(u.key!=="Tab")return;const k=Array.from(d.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(k.length===0)return;const v=k[0],ie=k[k.length-1],z=document.activeElement;if(u.shiftKey&&z===v){u.preventDefault(),ie.focus();return}!u.shiftKey&&z===ie&&(u.preventDefault(),v.focus())},_=async()=>{var ie;const u={condition:((ie=m==null?void 0:m.value)==null?void 0:ie.trim())||"",audience:K(N==null?void 0:N.value),locale:K(D==null?void 0:D.value),hasElse:(P==null?void 0:P.checked)||!1},k=e.innerHTML;if(n)Qe(n,u,a),oe(n,T.get(e)===!0);else{Ye(e,r);const z=Ne(u,a);try{De(e,z)}catch{e.appendChild(z);const Ce=z.querySelector('.rte-conditional-body[data-slot="if"]');Ce?pe(e,Ce):pe(e,z)}}T.get(e)===!0&&await Z(e,t,!0),Te(e),Be(e,k),R(e),C()},V=u=>{if(u.key==="Escape"){u.preventDefault(),C();return}ge(u),u.key==="Enter"&&!u.shiftKey&&u.target instanceof HTMLInputElement&&(u.preventDefault(),_())};d.addEventListener("click",u=>{const v=u.target.getAttribute("data-action");if(v==="cancel"){C();return}v==="save"&&_()}),l.addEventListener("click",de),l.addEventListener("keydown",V,!0),document.addEventListener("keydown",ce,!0),ae={cleanup:C},m==null||m.focus()}function nt(e){const t=e.metaKey||e.ctrlKey,i=(typeof e.key=="string"?e.key:"").toLowerCase(),n=typeof e.code=="string"?e.code.toLowerCase():"",a=t&&e.altKey&&e.shiftKey&&(i==="c"||n==="keyc"),r=!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&(i==="f9"||n==="f9");return a||r}function it(e){const t=e.metaKey||e.ctrlKey,i=(typeof e.key=="string"?e.key:"").toLowerCase(),n=typeof e.code=="string"?e.code.toLowerCase():"",a=t&&e.altKey&&e.shiftKey&&(i==="p"||n==="keyp"),r=!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&(i==="f10"||n==="f10");return a||r}function at(e){ee=e,U||(U=t=>{const o=t.target,i=o==null?void 0:o.closest(w);if(!i)return;y=i,x.has(i)||x.set(i,e);const n=x.get(i)||e;ne(i,n.labels),He(i,T.get(i)===!0),R(i)},document.addEventListener("focusin",U,!0)),G||(G=t=>{var L;if(document.querySelector(`.${c}`))return;const i=t.target;if(!!(i!=null&&i.closest("input, textarea, select")))return;const r=(i==null?void 0:i.closest(w))||S(void 0,!1)||y;if(!r||H(r))return;const l=x.get(r)||ee||e,d=document.activeElement,E=(i==null?void 0:i.closest(".rte-conditional-header"))||(d==null?void 0:d.closest(".rte-conditional-header"));if(E&&(t.key==="Enter"||t.key===" ")){const p=E.closest(q);if(p&&r.contains(p)){t.preventDefault(),t.stopPropagation(),A(r,l,"edit",void 0,p);return}}if(nt(t)){t.preventDefault(),t.stopPropagation();const p=W(r);p?A(r,l,"edit",void 0,p):A(r,l,"insert");return}if(it(t)){t.preventDefault(),t.stopPropagation();const p=T.get(r)!==!0;Z(r,l,p),R(r);return}if((t.key==="Backspace"||t.key==="Delete")&&!t.altKey&&!t.ctrlKey&&!t.metaKey){const p=window.getSelection();if(!p||p.rangeCount===0)return;const B=p.getRangeAt(0);if(!B.collapsed||!r.contains(B.commonAncestorContainer))return;const M=(L=We(B.startContainer))==null?void 0:L.closest(".rte-conditional-body");if(!M||!r.contains(M))return;if(t.key==="Backspace"&&ke(B,M,"start")){t.preventDefault();return}if(t.key==="Delete"&&ke(B,M,"end")){t.preventDefault();return}}},document.addEventListener("keydown",G,!0)),J||(J=t=>{const o=t.target;if(!o||o.closest(`.${s}`))return;const i=o.closest(w);if(!i){y&&F(y);return}if(H(i))return;y=i,x.has(i)||x.set(i,e);const n=o.closest(q);if(!n){F(i);return}requestAnimationFrame(()=>{!i.isConnected||!i.contains(n)||me(i,n)})},document.addEventListener("mousedown",J,!0)),Y||(Y=t=>{const o=t.target;if(!o||o.closest(`.${s}`))return;const i=o.closest(w);if(!i){y&&F(y);return}if(H(i))return;y=i,x.has(i)||x.set(i,e);const n=x.get(i)||e,a=o.closest(q),r=!!o.closest(".rte-conditional-header, .rte-conditional-summary, .rte-conditional-meta, .rte-conditional-else-label");if(a&&r){t.preventDefault(),t.stopPropagation(),A(i,n,"edit",void 0,a),me(i,a);return}a?me(i,a):F(i)},document.addEventListener("click",Y,!0)),X||(X=()=>{const t=S(void 0,!1)||y;t&&t.isConnected&&R(t)},document.addEventListener("selectionchange",X)),Q||(Q=t=>{const o=t.target,i=o==null?void 0:o.closest(w);if(!i)return;const n=x.get(i)||ee||e;ne(i,n.labels),R(i)},document.addEventListener("input",Q,!0)),O||(O=()=>{ot()},window.addEventListener("scroll",O,!0),window.addEventListener("resize",O))}function rt(){U&&(document.removeEventListener("focusin",U,!0),U=null),G&&(document.removeEventListener("keydown",G,!0),G=null),Y&&(document.removeEventListener("click",Y,!0),Y=null),J&&(document.removeEventListener("mousedown",J,!0),J=null),X&&(document.removeEventListener("selectionchange",X),X=null),Q&&(document.removeEventListener("input",Q,!0),Q=null),O&&(window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),O=null),j.forEach(e=>{e.remove()}),j.clear(),I.clear(),ee=null,y=null}const lt=(e={})=>{const t=Ve(e);return Ie(),{name:"conditionalContent",toolbar:[{id:"conditionalContentGroup",label:"Conditional Content",type:"group",command:"conditionalContent",items:[{id:"conditionalContent",label:"Conditional Rule",command:"openConditionalDialog",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M6 5h12a1 1 0 0 1 1 1v3h-2V7H7v3H5V6a1 1 0 0 1 1-1Zm-1 9h2v3h10v-3h2v4a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-4Zm3-2a1 1 0 0 1 1-1h2.6l1.8-2.4a1 1 0 1 1 1.6 1.2L13.8 11H15a1 1 0 1 1 0 2h-2.7l-1.9 2.5a1 1 0 1 1-1.6-1.2L10.1 13H9a1 1 0 0 1-1-1Z" fill="currentColor"></path></svg>',shortcut:"Mod-Alt-Shift-c"},{id:"conditionalPreview",label:"Conditional Preview",command:"toggleConditionalPreview",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M4 6h16a1 1 0 0 1 1 1v3h-2V8H5v8h14v-2h2v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm5 3h2v2H9V9Zm0 4h2v2H9v-2Zm4-4h6v2h-6V9Zm0 4h6v2h-6v-2Z" fill="currentColor"></path></svg>',shortcut:"Mod-Alt-Shift-p"}]}],commands:{conditionalContent:(o,i)=>{const n=S(i);if(!n||H(n))return!1;y=n,x.set(n,t),ne(n,t.labels);const a=o==null?void 0:o.target;if(a==="insert")return A(n,t,"insert",o),!0;const r=W(n);return a==="edit"||r?!r&&a==="edit"?!1:(A(n,t,"edit",o,r||void 0),!0):(A(n,t,"insert",o),!0)},openConditionalDialog:(o,i)=>{const n=S(i);if(!n||H(n))return!1;y=n,x.set(n,t),ne(n,t.labels);const a=o==null?void 0:o.target;if(a==="insert")return A(n,t,"insert",o),!0;const r=W(n);return a==="edit"||r?!r&&a==="edit"?!1:(A(n,t,"edit",o,r||void 0),!0):(A(n,t,"insert",o),!0)},conditionalPreview:async(o,i)=>{const n=S(i);if(!n)return!1;y=n,x.set(n,t);const a=typeof o=="boolean"?o:T.get(n)!==!0;return await Z(n,t,a),R(n),!0},editConditionalBlock:(o,i)=>{const n=S(i);if(!n||H(n))return!1;y=n,x.set(n,t);const a=W(n);return a?(A(n,t,"edit",o,a),!0):!1},deleteConditionalBlock:(o,i)=>{const n=S(i);if(!n||H(n))return!1;const a=W(n);if(!a)return!1;const r=Oe(n,a);return r&&R(n),r},insertConditionalBlock:(o,i)=>{const n=S(i);if(!n||H(n))return!1;y=n,x.set(n,t);const a={condition:(o==null?void 0:o.condition)??t.defaultCondition,audience:(o==null?void 0:o.audience)??t.defaultAudience,locale:(o==null?void 0:o.locale)??t.defaultLocale,hasElse:(o==null?void 0:o.hasElse)??t.enableElseByDefault},r=Ne(a,t.labels);return De(n,r),T.get(n)===!0&&Z(n,t,!0),!0},toggleConditionalPreview:async(o,i)=>{const n=S(i);if(!n)return!1;y=n,x.set(n,t);const a=typeof o=="boolean"?o:T.get(n)!==!0;return await Z(n,t,a),!0},setConditionalContext:(o,i)=>{const n=S(i);return n?(y=n,!o||typeof o!="object"?$e.delete(n):$e.set(n,o),T.get(n)===!0&&Z(n,t,!0),!0):!1}},keymap:{"Mod-Alt-Shift-c":"openConditionalDialog","Mod-Alt-Shift-C":"openConditionalDialog","Mod-Alt-Shift-p":"toggleConditionalPreview","Mod-Alt-Shift-P":"toggleConditionalPreview",F9:"openConditionalDialog",F10:"toggleConditionalPreview"},init:()=>{se+=1,at(t)},destroy:()=>{se=Math.max(0,se-1),se===0&&(Me(),rt())}}};exports.ConditionalContentPlugin=lt;
|