@ankhorage/zora 28.3.0 → 28.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +52 -1
- package/dist/capabilities/index.js.map +6 -5
- package/dist/constants/authoring.d.ts +4 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +2 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
- package/dist/features/reader/meta.d.ts +2 -2
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +2 -0
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
- package/dist/features/registry/componentMeta.d.ts.map +1 -1
- package/dist/features/registry/componentMeta.js +2 -0
- package/dist/features/registry/componentMeta.js.map +1 -1
- package/dist/features/rich-text/adapters/inbound/RichText.d.ts +11 -0
- package/dist/features/rich-text/adapters/inbound/RichText.d.ts.map +1 -0
- package/dist/features/rich-text/adapters/inbound/RichText.js +11 -0
- package/dist/features/rich-text/adapters/inbound/RichText.js.map +1 -0
- package/dist/features/rich-text/adapters/inbound/RichText.web.d.ts +5 -0
- package/dist/features/rich-text/adapters/inbound/RichText.web.d.ts.map +1 -0
- package/dist/features/rich-text/adapters/inbound/RichText.web.js +17 -0
- package/dist/features/rich-text/adapters/inbound/RichText.web.js.map +1 -0
- package/dist/features/rich-text/adapters/inbound/RichTextClient.d.ts +5 -0
- package/dist/features/rich-text/adapters/inbound/RichTextClient.d.ts.map +1 -0
- package/dist/features/rich-text/adapters/inbound/RichTextClient.js +94 -0
- package/dist/features/rich-text/adapters/inbound/RichTextClient.js.map +1 -0
- package/dist/features/rich-text/public.d.ts +3 -0
- package/dist/features/rich-text/public.d.ts.map +1 -0
- package/dist/features/rich-text/public.js +2 -0
- package/dist/features/rich-text/public.js.map +1 -0
- package/dist/features/rich-text/richTextMeta.d.ts +65 -0
- package/dist/features/rich-text/richTextMeta.d.ts.map +1 -0
- package/dist/features/rich-text/richTextMeta.js +48 -0
- package/dist/features/rich-text/richTextMeta.js.map +1 -0
- package/dist/features/rich-text/utils/resolveRichTextHtmlStyle.d.ts +5 -0
- package/dist/features/rich-text/utils/resolveRichTextHtmlStyle.d.ts.map +1 -0
- package/dist/features/rich-text/utils/resolveRichTextHtmlStyle.js +29 -0
- package/dist/features/rich-text/utils/resolveRichTextHtmlStyle.js.map +1 -0
- package/dist/features/rich-text/utils/sanitizeRichTextHtml.d.ts +3 -0
- package/dist/features/rich-text/utils/sanitizeRichTextHtml.d.ts.map +1 -0
- package/dist/features/rich-text/utils/sanitizeRichTextHtml.js +38 -0
- package/dist/features/rich-text/utils/sanitizeRichTextHtml.js.map +1 -0
- package/dist/features/scanner/meta.d.ts +2 -2
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/readerFree.d.ts +1 -0
- package/dist/readerFree.d.ts.map +1 -1
- package/dist/readerFree.js +1 -0
- package/dist/readerFree.js.map +1 -1
- package/dist/types/rich-text.d.ts +24 -0
- package/dist/types/rich-text.d.ts.map +1 -0
- package/dist/types/rich-text.js +2 -0
- package/dist/types/rich-text.js.map +1 -0
- package/package.json +56 -2
- package/src/constants/authoring.ts +2 -0
- package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +2 -0
- package/src/features/registry/componentMeta.test.ts +1 -0
- package/src/features/registry/componentMeta.ts +2 -0
- package/src/features/rich-text/adapters/inbound/RichText.tsx +15 -0
- package/src/features/rich-text/adapters/inbound/RichText.web.tsx +28 -0
- package/src/features/rich-text/adapters/inbound/RichTextClient.tsx +246 -0
- package/src/features/rich-text/public.ts +2 -0
- package/src/features/rich-text/richTextMeta.test.ts +52 -0
- package/src/features/rich-text/richTextMeta.ts +50 -0
- package/src/features/rich-text/utils/resolveRichTextHtmlStyle.test.ts +17 -0
- package/src/features/rich-text/utils/resolveRichTextHtmlStyle.ts +31 -0
- package/src/features/rich-text/utils/sanitizeRichTextHtml.test.ts +29 -0
- package/src/features/rich-text/utils/sanitizeRichTextHtml.ts +40 -0
- package/src/readerFree.ts +1 -0
- package/src/types/rich-text.ts +24 -0
- package/src/webPackageExports.test.ts +9 -0
- package/web-dist/chunks/Accordion-v86n9tvj.js +37 -0
- package/web-dist/chunks/RichTextClient-8x3t7bwd.js +1676 -0
- package/web-dist/components/reader/Reader.js +1 -1
- package/web-dist/components/rich-text/RichText.d.ts +13 -0
- package/web-dist/components/rich-text/RichText.dependency-0.d.ts +27 -0
- package/web-dist/components/rich-text/RichText.dependency-1.d.ts +3 -0
- package/web-dist/components/rich-text/RichText.js +35 -0
- package/web-dist/components/rich-text/RichText.types-0.d.ts +24 -0
- package/web-dist/components/rich-text/index.d.ts +2 -0
- package/web-dist/components/rich-text/index.js +2 -0
- package/web-dist/components/toolbar/Toolbar.js +7 -36
- package/web-dist/manifest.json +49 -0
|
@@ -0,0 +1,1676 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import"./Accordion-0dj1r7w3.js";
|
|
3
|
+
import"./Accordion-9d38cgqj.js";
|
|
4
|
+
import"./Accordion-wgc67k1g.js";
|
|
5
|
+
import"./Accordion-ww4f12ty.js";
|
|
6
|
+
import"./Accordion-hdyzyw8q.js";
|
|
7
|
+
import"./Accordion-kcm6jcpp.js";
|
|
8
|
+
import {
|
|
9
|
+
IconButton2
|
|
10
|
+
} from "./Accordion-f1vargnk.js";
|
|
11
|
+
import"./Accordion-76b0qz8y.js";
|
|
12
|
+
import"./Accordion-tk8zf9ff.js";
|
|
13
|
+
import {
|
|
14
|
+
View2
|
|
15
|
+
} from "./Accordion-f8a49gy8.js";
|
|
16
|
+
import"./Accordion-d405whfb.js";
|
|
17
|
+
import {
|
|
18
|
+
TextInput2
|
|
19
|
+
} from "./Accordion-5rwztz14.js";
|
|
20
|
+
import"./Accordion-pdjhezmz.js";
|
|
21
|
+
import"./Accordion-2xkxthf1.js";
|
|
22
|
+
import"./Accordion-8skz71ct.js";
|
|
23
|
+
import"./Accordion-sh79sr5g.js";
|
|
24
|
+
import"./Accordion-3zzzw7a8.js";
|
|
25
|
+
import"./Accordion-a1mgdfg7.js";
|
|
26
|
+
import"./Accordion-01bsg7zt.js";
|
|
27
|
+
import {
|
|
28
|
+
Toolbar2
|
|
29
|
+
} from "./Accordion-v86n9tvj.js";
|
|
30
|
+
import"./Accordion-eqvdv7tt.js";
|
|
31
|
+
import"./Accordion-61e19g3e.js";
|
|
32
|
+
import"./Accordion-c6edgxay.js";
|
|
33
|
+
import"./Accordion-yrac5a7m.js";
|
|
34
|
+
import {
|
|
35
|
+
useZoraTheme2
|
|
36
|
+
} from "./Accordion-b1y5mjac.js";
|
|
37
|
+
import"./Accordion-fre84yaq.js";
|
|
38
|
+
import"./Accordion-xgpzh4wq.js";
|
|
39
|
+
import {
|
|
40
|
+
__toESM,
|
|
41
|
+
__commonJS
|
|
42
|
+
} from "./Accordion-nh0cs9hq.js";
|
|
43
|
+
|
|
44
|
+
// node_modules/cssfilter/lib/default.js
|
|
45
|
+
var require_default = __commonJS(function(exports) {
|
|
46
|
+
function getDefaultWhiteList() {
|
|
47
|
+
var whiteList = {};
|
|
48
|
+
whiteList["align-content"] = false;
|
|
49
|
+
whiteList["align-items"] = false;
|
|
50
|
+
whiteList["align-self"] = false;
|
|
51
|
+
whiteList["alignment-adjust"] = false;
|
|
52
|
+
whiteList["alignment-baseline"] = false;
|
|
53
|
+
whiteList["all"] = false;
|
|
54
|
+
whiteList["anchor-point"] = false;
|
|
55
|
+
whiteList["animation"] = false;
|
|
56
|
+
whiteList["animation-delay"] = false;
|
|
57
|
+
whiteList["animation-direction"] = false;
|
|
58
|
+
whiteList["animation-duration"] = false;
|
|
59
|
+
whiteList["animation-fill-mode"] = false;
|
|
60
|
+
whiteList["animation-iteration-count"] = false;
|
|
61
|
+
whiteList["animation-name"] = false;
|
|
62
|
+
whiteList["animation-play-state"] = false;
|
|
63
|
+
whiteList["animation-timing-function"] = false;
|
|
64
|
+
whiteList["azimuth"] = false;
|
|
65
|
+
whiteList["backface-visibility"] = false;
|
|
66
|
+
whiteList["background"] = true;
|
|
67
|
+
whiteList["background-attachment"] = true;
|
|
68
|
+
whiteList["background-clip"] = true;
|
|
69
|
+
whiteList["background-color"] = true;
|
|
70
|
+
whiteList["background-image"] = true;
|
|
71
|
+
whiteList["background-origin"] = true;
|
|
72
|
+
whiteList["background-position"] = true;
|
|
73
|
+
whiteList["background-repeat"] = true;
|
|
74
|
+
whiteList["background-size"] = true;
|
|
75
|
+
whiteList["baseline-shift"] = false;
|
|
76
|
+
whiteList["binding"] = false;
|
|
77
|
+
whiteList["bleed"] = false;
|
|
78
|
+
whiteList["bookmark-label"] = false;
|
|
79
|
+
whiteList["bookmark-level"] = false;
|
|
80
|
+
whiteList["bookmark-state"] = false;
|
|
81
|
+
whiteList["border"] = true;
|
|
82
|
+
whiteList["border-bottom"] = true;
|
|
83
|
+
whiteList["border-bottom-color"] = true;
|
|
84
|
+
whiteList["border-bottom-left-radius"] = true;
|
|
85
|
+
whiteList["border-bottom-right-radius"] = true;
|
|
86
|
+
whiteList["border-bottom-style"] = true;
|
|
87
|
+
whiteList["border-bottom-width"] = true;
|
|
88
|
+
whiteList["border-collapse"] = true;
|
|
89
|
+
whiteList["border-color"] = true;
|
|
90
|
+
whiteList["border-image"] = true;
|
|
91
|
+
whiteList["border-image-outset"] = true;
|
|
92
|
+
whiteList["border-image-repeat"] = true;
|
|
93
|
+
whiteList["border-image-slice"] = true;
|
|
94
|
+
whiteList["border-image-source"] = true;
|
|
95
|
+
whiteList["border-image-width"] = true;
|
|
96
|
+
whiteList["border-left"] = true;
|
|
97
|
+
whiteList["border-left-color"] = true;
|
|
98
|
+
whiteList["border-left-style"] = true;
|
|
99
|
+
whiteList["border-left-width"] = true;
|
|
100
|
+
whiteList["border-radius"] = true;
|
|
101
|
+
whiteList["border-right"] = true;
|
|
102
|
+
whiteList["border-right-color"] = true;
|
|
103
|
+
whiteList["border-right-style"] = true;
|
|
104
|
+
whiteList["border-right-width"] = true;
|
|
105
|
+
whiteList["border-spacing"] = true;
|
|
106
|
+
whiteList["border-style"] = true;
|
|
107
|
+
whiteList["border-top"] = true;
|
|
108
|
+
whiteList["border-top-color"] = true;
|
|
109
|
+
whiteList["border-top-left-radius"] = true;
|
|
110
|
+
whiteList["border-top-right-radius"] = true;
|
|
111
|
+
whiteList["border-top-style"] = true;
|
|
112
|
+
whiteList["border-top-width"] = true;
|
|
113
|
+
whiteList["border-width"] = true;
|
|
114
|
+
whiteList["bottom"] = false;
|
|
115
|
+
whiteList["box-decoration-break"] = true;
|
|
116
|
+
whiteList["box-shadow"] = true;
|
|
117
|
+
whiteList["box-sizing"] = true;
|
|
118
|
+
whiteList["box-snap"] = true;
|
|
119
|
+
whiteList["box-suppress"] = true;
|
|
120
|
+
whiteList["break-after"] = true;
|
|
121
|
+
whiteList["break-before"] = true;
|
|
122
|
+
whiteList["break-inside"] = true;
|
|
123
|
+
whiteList["caption-side"] = false;
|
|
124
|
+
whiteList["chains"] = false;
|
|
125
|
+
whiteList["clear"] = true;
|
|
126
|
+
whiteList["clip"] = false;
|
|
127
|
+
whiteList["clip-path"] = false;
|
|
128
|
+
whiteList["clip-rule"] = false;
|
|
129
|
+
whiteList["color"] = true;
|
|
130
|
+
whiteList["color-interpolation-filters"] = true;
|
|
131
|
+
whiteList["column-count"] = false;
|
|
132
|
+
whiteList["column-fill"] = false;
|
|
133
|
+
whiteList["column-gap"] = false;
|
|
134
|
+
whiteList["column-rule"] = false;
|
|
135
|
+
whiteList["column-rule-color"] = false;
|
|
136
|
+
whiteList["column-rule-style"] = false;
|
|
137
|
+
whiteList["column-rule-width"] = false;
|
|
138
|
+
whiteList["column-span"] = false;
|
|
139
|
+
whiteList["column-width"] = false;
|
|
140
|
+
whiteList["columns"] = false;
|
|
141
|
+
whiteList["contain"] = false;
|
|
142
|
+
whiteList["content"] = false;
|
|
143
|
+
whiteList["counter-increment"] = false;
|
|
144
|
+
whiteList["counter-reset"] = false;
|
|
145
|
+
whiteList["counter-set"] = false;
|
|
146
|
+
whiteList["crop"] = false;
|
|
147
|
+
whiteList["cue"] = false;
|
|
148
|
+
whiteList["cue-after"] = false;
|
|
149
|
+
whiteList["cue-before"] = false;
|
|
150
|
+
whiteList["cursor"] = false;
|
|
151
|
+
whiteList["direction"] = false;
|
|
152
|
+
whiteList["display"] = true;
|
|
153
|
+
whiteList["display-inside"] = true;
|
|
154
|
+
whiteList["display-list"] = true;
|
|
155
|
+
whiteList["display-outside"] = true;
|
|
156
|
+
whiteList["dominant-baseline"] = false;
|
|
157
|
+
whiteList["elevation"] = false;
|
|
158
|
+
whiteList["empty-cells"] = false;
|
|
159
|
+
whiteList["filter"] = false;
|
|
160
|
+
whiteList["flex"] = false;
|
|
161
|
+
whiteList["flex-basis"] = false;
|
|
162
|
+
whiteList["flex-direction"] = false;
|
|
163
|
+
whiteList["flex-flow"] = false;
|
|
164
|
+
whiteList["flex-grow"] = false;
|
|
165
|
+
whiteList["flex-shrink"] = false;
|
|
166
|
+
whiteList["flex-wrap"] = false;
|
|
167
|
+
whiteList["float"] = false;
|
|
168
|
+
whiteList["float-offset"] = false;
|
|
169
|
+
whiteList["flood-color"] = false;
|
|
170
|
+
whiteList["flood-opacity"] = false;
|
|
171
|
+
whiteList["flow-from"] = false;
|
|
172
|
+
whiteList["flow-into"] = false;
|
|
173
|
+
whiteList["font"] = true;
|
|
174
|
+
whiteList["font-family"] = true;
|
|
175
|
+
whiteList["font-feature-settings"] = true;
|
|
176
|
+
whiteList["font-kerning"] = true;
|
|
177
|
+
whiteList["font-language-override"] = true;
|
|
178
|
+
whiteList["font-size"] = true;
|
|
179
|
+
whiteList["font-size-adjust"] = true;
|
|
180
|
+
whiteList["font-stretch"] = true;
|
|
181
|
+
whiteList["font-style"] = true;
|
|
182
|
+
whiteList["font-synthesis"] = true;
|
|
183
|
+
whiteList["font-variant"] = true;
|
|
184
|
+
whiteList["font-variant-alternates"] = true;
|
|
185
|
+
whiteList["font-variant-caps"] = true;
|
|
186
|
+
whiteList["font-variant-east-asian"] = true;
|
|
187
|
+
whiteList["font-variant-ligatures"] = true;
|
|
188
|
+
whiteList["font-variant-numeric"] = true;
|
|
189
|
+
whiteList["font-variant-position"] = true;
|
|
190
|
+
whiteList["font-weight"] = true;
|
|
191
|
+
whiteList["grid"] = false;
|
|
192
|
+
whiteList["grid-area"] = false;
|
|
193
|
+
whiteList["grid-auto-columns"] = false;
|
|
194
|
+
whiteList["grid-auto-flow"] = false;
|
|
195
|
+
whiteList["grid-auto-rows"] = false;
|
|
196
|
+
whiteList["grid-column"] = false;
|
|
197
|
+
whiteList["grid-column-end"] = false;
|
|
198
|
+
whiteList["grid-column-start"] = false;
|
|
199
|
+
whiteList["grid-row"] = false;
|
|
200
|
+
whiteList["grid-row-end"] = false;
|
|
201
|
+
whiteList["grid-row-start"] = false;
|
|
202
|
+
whiteList["grid-template"] = false;
|
|
203
|
+
whiteList["grid-template-areas"] = false;
|
|
204
|
+
whiteList["grid-template-columns"] = false;
|
|
205
|
+
whiteList["grid-template-rows"] = false;
|
|
206
|
+
whiteList["hanging-punctuation"] = false;
|
|
207
|
+
whiteList["height"] = true;
|
|
208
|
+
whiteList["hyphens"] = false;
|
|
209
|
+
whiteList["icon"] = false;
|
|
210
|
+
whiteList["image-orientation"] = false;
|
|
211
|
+
whiteList["image-resolution"] = false;
|
|
212
|
+
whiteList["ime-mode"] = false;
|
|
213
|
+
whiteList["initial-letters"] = false;
|
|
214
|
+
whiteList["inline-box-align"] = false;
|
|
215
|
+
whiteList["justify-content"] = false;
|
|
216
|
+
whiteList["justify-items"] = false;
|
|
217
|
+
whiteList["justify-self"] = false;
|
|
218
|
+
whiteList["left"] = false;
|
|
219
|
+
whiteList["letter-spacing"] = true;
|
|
220
|
+
whiteList["lighting-color"] = true;
|
|
221
|
+
whiteList["line-box-contain"] = false;
|
|
222
|
+
whiteList["line-break"] = false;
|
|
223
|
+
whiteList["line-grid"] = false;
|
|
224
|
+
whiteList["line-height"] = false;
|
|
225
|
+
whiteList["line-snap"] = false;
|
|
226
|
+
whiteList["line-stacking"] = false;
|
|
227
|
+
whiteList["line-stacking-ruby"] = false;
|
|
228
|
+
whiteList["line-stacking-shift"] = false;
|
|
229
|
+
whiteList["line-stacking-strategy"] = false;
|
|
230
|
+
whiteList["list-style"] = true;
|
|
231
|
+
whiteList["list-style-image"] = true;
|
|
232
|
+
whiteList["list-style-position"] = true;
|
|
233
|
+
whiteList["list-style-type"] = true;
|
|
234
|
+
whiteList["margin"] = true;
|
|
235
|
+
whiteList["margin-bottom"] = true;
|
|
236
|
+
whiteList["margin-left"] = true;
|
|
237
|
+
whiteList["margin-right"] = true;
|
|
238
|
+
whiteList["margin-top"] = true;
|
|
239
|
+
whiteList["marker-offset"] = false;
|
|
240
|
+
whiteList["marker-side"] = false;
|
|
241
|
+
whiteList["marks"] = false;
|
|
242
|
+
whiteList["mask"] = false;
|
|
243
|
+
whiteList["mask-box"] = false;
|
|
244
|
+
whiteList["mask-box-outset"] = false;
|
|
245
|
+
whiteList["mask-box-repeat"] = false;
|
|
246
|
+
whiteList["mask-box-slice"] = false;
|
|
247
|
+
whiteList["mask-box-source"] = false;
|
|
248
|
+
whiteList["mask-box-width"] = false;
|
|
249
|
+
whiteList["mask-clip"] = false;
|
|
250
|
+
whiteList["mask-image"] = false;
|
|
251
|
+
whiteList["mask-origin"] = false;
|
|
252
|
+
whiteList["mask-position"] = false;
|
|
253
|
+
whiteList["mask-repeat"] = false;
|
|
254
|
+
whiteList["mask-size"] = false;
|
|
255
|
+
whiteList["mask-source-type"] = false;
|
|
256
|
+
whiteList["mask-type"] = false;
|
|
257
|
+
whiteList["max-height"] = true;
|
|
258
|
+
whiteList["max-lines"] = false;
|
|
259
|
+
whiteList["max-width"] = true;
|
|
260
|
+
whiteList["min-height"] = true;
|
|
261
|
+
whiteList["min-width"] = true;
|
|
262
|
+
whiteList["move-to"] = false;
|
|
263
|
+
whiteList["nav-down"] = false;
|
|
264
|
+
whiteList["nav-index"] = false;
|
|
265
|
+
whiteList["nav-left"] = false;
|
|
266
|
+
whiteList["nav-right"] = false;
|
|
267
|
+
whiteList["nav-up"] = false;
|
|
268
|
+
whiteList["object-fit"] = false;
|
|
269
|
+
whiteList["object-position"] = false;
|
|
270
|
+
whiteList["opacity"] = false;
|
|
271
|
+
whiteList["order"] = false;
|
|
272
|
+
whiteList["orphans"] = false;
|
|
273
|
+
whiteList["outline"] = false;
|
|
274
|
+
whiteList["outline-color"] = false;
|
|
275
|
+
whiteList["outline-offset"] = false;
|
|
276
|
+
whiteList["outline-style"] = false;
|
|
277
|
+
whiteList["outline-width"] = false;
|
|
278
|
+
whiteList["overflow"] = false;
|
|
279
|
+
whiteList["overflow-wrap"] = false;
|
|
280
|
+
whiteList["overflow-x"] = false;
|
|
281
|
+
whiteList["overflow-y"] = false;
|
|
282
|
+
whiteList["padding"] = true;
|
|
283
|
+
whiteList["padding-bottom"] = true;
|
|
284
|
+
whiteList["padding-left"] = true;
|
|
285
|
+
whiteList["padding-right"] = true;
|
|
286
|
+
whiteList["padding-top"] = true;
|
|
287
|
+
whiteList["page"] = false;
|
|
288
|
+
whiteList["page-break-after"] = false;
|
|
289
|
+
whiteList["page-break-before"] = false;
|
|
290
|
+
whiteList["page-break-inside"] = false;
|
|
291
|
+
whiteList["page-policy"] = false;
|
|
292
|
+
whiteList["pause"] = false;
|
|
293
|
+
whiteList["pause-after"] = false;
|
|
294
|
+
whiteList["pause-before"] = false;
|
|
295
|
+
whiteList["perspective"] = false;
|
|
296
|
+
whiteList["perspective-origin"] = false;
|
|
297
|
+
whiteList["pitch"] = false;
|
|
298
|
+
whiteList["pitch-range"] = false;
|
|
299
|
+
whiteList["play-during"] = false;
|
|
300
|
+
whiteList["position"] = false;
|
|
301
|
+
whiteList["presentation-level"] = false;
|
|
302
|
+
whiteList["quotes"] = false;
|
|
303
|
+
whiteList["region-fragment"] = false;
|
|
304
|
+
whiteList["resize"] = false;
|
|
305
|
+
whiteList["rest"] = false;
|
|
306
|
+
whiteList["rest-after"] = false;
|
|
307
|
+
whiteList["rest-before"] = false;
|
|
308
|
+
whiteList["richness"] = false;
|
|
309
|
+
whiteList["right"] = false;
|
|
310
|
+
whiteList["rotation"] = false;
|
|
311
|
+
whiteList["rotation-point"] = false;
|
|
312
|
+
whiteList["ruby-align"] = false;
|
|
313
|
+
whiteList["ruby-merge"] = false;
|
|
314
|
+
whiteList["ruby-position"] = false;
|
|
315
|
+
whiteList["shape-image-threshold"] = false;
|
|
316
|
+
whiteList["shape-outside"] = false;
|
|
317
|
+
whiteList["shape-margin"] = false;
|
|
318
|
+
whiteList["size"] = false;
|
|
319
|
+
whiteList["speak"] = false;
|
|
320
|
+
whiteList["speak-as"] = false;
|
|
321
|
+
whiteList["speak-header"] = false;
|
|
322
|
+
whiteList["speak-numeral"] = false;
|
|
323
|
+
whiteList["speak-punctuation"] = false;
|
|
324
|
+
whiteList["speech-rate"] = false;
|
|
325
|
+
whiteList["stress"] = false;
|
|
326
|
+
whiteList["string-set"] = false;
|
|
327
|
+
whiteList["tab-size"] = false;
|
|
328
|
+
whiteList["table-layout"] = false;
|
|
329
|
+
whiteList["text-align"] = true;
|
|
330
|
+
whiteList["text-align-last"] = true;
|
|
331
|
+
whiteList["text-combine-upright"] = true;
|
|
332
|
+
whiteList["text-decoration"] = true;
|
|
333
|
+
whiteList["text-decoration-color"] = true;
|
|
334
|
+
whiteList["text-decoration-line"] = true;
|
|
335
|
+
whiteList["text-decoration-skip"] = true;
|
|
336
|
+
whiteList["text-decoration-style"] = true;
|
|
337
|
+
whiteList["text-emphasis"] = true;
|
|
338
|
+
whiteList["text-emphasis-color"] = true;
|
|
339
|
+
whiteList["text-emphasis-position"] = true;
|
|
340
|
+
whiteList["text-emphasis-style"] = true;
|
|
341
|
+
whiteList["text-height"] = true;
|
|
342
|
+
whiteList["text-indent"] = true;
|
|
343
|
+
whiteList["text-justify"] = true;
|
|
344
|
+
whiteList["text-orientation"] = true;
|
|
345
|
+
whiteList["text-overflow"] = true;
|
|
346
|
+
whiteList["text-shadow"] = true;
|
|
347
|
+
whiteList["text-space-collapse"] = true;
|
|
348
|
+
whiteList["text-transform"] = true;
|
|
349
|
+
whiteList["text-underline-position"] = true;
|
|
350
|
+
whiteList["text-wrap"] = true;
|
|
351
|
+
whiteList["top"] = false;
|
|
352
|
+
whiteList["transform"] = false;
|
|
353
|
+
whiteList["transform-origin"] = false;
|
|
354
|
+
whiteList["transform-style"] = false;
|
|
355
|
+
whiteList["transition"] = false;
|
|
356
|
+
whiteList["transition-delay"] = false;
|
|
357
|
+
whiteList["transition-duration"] = false;
|
|
358
|
+
whiteList["transition-property"] = false;
|
|
359
|
+
whiteList["transition-timing-function"] = false;
|
|
360
|
+
whiteList["unicode-bidi"] = false;
|
|
361
|
+
whiteList["vertical-align"] = false;
|
|
362
|
+
whiteList["visibility"] = false;
|
|
363
|
+
whiteList["voice-balance"] = false;
|
|
364
|
+
whiteList["voice-duration"] = false;
|
|
365
|
+
whiteList["voice-family"] = false;
|
|
366
|
+
whiteList["voice-pitch"] = false;
|
|
367
|
+
whiteList["voice-range"] = false;
|
|
368
|
+
whiteList["voice-rate"] = false;
|
|
369
|
+
whiteList["voice-stress"] = false;
|
|
370
|
+
whiteList["voice-volume"] = false;
|
|
371
|
+
whiteList["volume"] = false;
|
|
372
|
+
whiteList["white-space"] = false;
|
|
373
|
+
whiteList["widows"] = false;
|
|
374
|
+
whiteList["width"] = true;
|
|
375
|
+
whiteList["will-change"] = false;
|
|
376
|
+
whiteList["word-break"] = true;
|
|
377
|
+
whiteList["word-spacing"] = true;
|
|
378
|
+
whiteList["word-wrap"] = true;
|
|
379
|
+
whiteList["wrap-flow"] = false;
|
|
380
|
+
whiteList["wrap-through"] = false;
|
|
381
|
+
whiteList["writing-mode"] = false;
|
|
382
|
+
whiteList["z-index"] = false;
|
|
383
|
+
return whiteList;
|
|
384
|
+
}
|
|
385
|
+
function onAttr(name, value, options) {}
|
|
386
|
+
function onIgnoreAttr(name, value, options) {}
|
|
387
|
+
var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/img;
|
|
388
|
+
function safeAttrValue(name, value) {
|
|
389
|
+
if (REGEXP_URL_JAVASCRIPT.test(value))
|
|
390
|
+
return "";
|
|
391
|
+
return value;
|
|
392
|
+
}
|
|
393
|
+
exports.whiteList = getDefaultWhiteList();
|
|
394
|
+
exports.getDefaultWhiteList = getDefaultWhiteList;
|
|
395
|
+
exports.onAttr = onAttr;
|
|
396
|
+
exports.onIgnoreAttr = onIgnoreAttr;
|
|
397
|
+
exports.safeAttrValue = safeAttrValue;
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// node_modules/cssfilter/lib/util.js
|
|
401
|
+
var require_util = __commonJS(function(exports, module) {
|
|
402
|
+
module.exports = {
|
|
403
|
+
indexOf: function(arr, item) {
|
|
404
|
+
var i, j;
|
|
405
|
+
if (Array.prototype.indexOf) {
|
|
406
|
+
return arr.indexOf(item);
|
|
407
|
+
}
|
|
408
|
+
for (i = 0, j = arr.length;i < j; i++) {
|
|
409
|
+
if (arr[i] === item) {
|
|
410
|
+
return i;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return -1;
|
|
414
|
+
},
|
|
415
|
+
forEach: function(arr, fn, scope) {
|
|
416
|
+
var i, j;
|
|
417
|
+
if (Array.prototype.forEach) {
|
|
418
|
+
return arr.forEach(fn, scope);
|
|
419
|
+
}
|
|
420
|
+
for (i = 0, j = arr.length;i < j; i++) {
|
|
421
|
+
fn.call(scope, arr[i], i, arr);
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
trim: function(str) {
|
|
425
|
+
if (String.prototype.trim) {
|
|
426
|
+
return str.trim();
|
|
427
|
+
}
|
|
428
|
+
return str.replace(/(^\s*)|(\s*$)/g, "");
|
|
429
|
+
},
|
|
430
|
+
trimRight: function(str) {
|
|
431
|
+
if (String.prototype.trimRight) {
|
|
432
|
+
return str.trimRight();
|
|
433
|
+
}
|
|
434
|
+
return str.replace(/(\s*$)/g, "");
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// node_modules/cssfilter/lib/parser.js
|
|
440
|
+
var require_parser = __commonJS(function(exports, module) {
|
|
441
|
+
var _ = require_util();
|
|
442
|
+
function parseStyle(css, onAttr) {
|
|
443
|
+
css = _.trimRight(css);
|
|
444
|
+
if (css[css.length - 1] !== ";")
|
|
445
|
+
css += ";";
|
|
446
|
+
var cssLength = css.length;
|
|
447
|
+
var isParenthesisOpen = false;
|
|
448
|
+
var lastPos = 0;
|
|
449
|
+
var i = 0;
|
|
450
|
+
var retCSS = "";
|
|
451
|
+
function addNewAttr() {
|
|
452
|
+
if (!isParenthesisOpen) {
|
|
453
|
+
var source = _.trim(css.slice(lastPos, i));
|
|
454
|
+
var j = source.indexOf(":");
|
|
455
|
+
if (j !== -1) {
|
|
456
|
+
var name = _.trim(source.slice(0, j));
|
|
457
|
+
var value = _.trim(source.slice(j + 1));
|
|
458
|
+
if (name) {
|
|
459
|
+
var ret = onAttr(lastPos, retCSS.length, name, value, source);
|
|
460
|
+
if (ret)
|
|
461
|
+
retCSS += ret + "; ";
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
lastPos = i + 1;
|
|
466
|
+
}
|
|
467
|
+
for (;i < cssLength; i++) {
|
|
468
|
+
var c = css[i];
|
|
469
|
+
if (c === "/" && css[i + 1] === "*") {
|
|
470
|
+
var j = css.indexOf("*/", i + 2);
|
|
471
|
+
if (j === -1)
|
|
472
|
+
break;
|
|
473
|
+
i = j + 1;
|
|
474
|
+
lastPos = i + 1;
|
|
475
|
+
isParenthesisOpen = false;
|
|
476
|
+
} else if (c === "(") {
|
|
477
|
+
isParenthesisOpen = true;
|
|
478
|
+
} else if (c === ")") {
|
|
479
|
+
isParenthesisOpen = false;
|
|
480
|
+
} else if (c === ";") {
|
|
481
|
+
if (isParenthesisOpen) {} else {
|
|
482
|
+
addNewAttr();
|
|
483
|
+
}
|
|
484
|
+
} else if (c === `
|
|
485
|
+
`) {
|
|
486
|
+
addNewAttr();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
return _.trim(retCSS);
|
|
490
|
+
}
|
|
491
|
+
module.exports = parseStyle;
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// node_modules/cssfilter/lib/css.js
|
|
495
|
+
var require_css = __commonJS(function(exports, module) {
|
|
496
|
+
var DEFAULT = require_default();
|
|
497
|
+
var parseStyle = require_parser();
|
|
498
|
+
var _ = require_util();
|
|
499
|
+
function isNull(obj) {
|
|
500
|
+
return obj === undefined || obj === null;
|
|
501
|
+
}
|
|
502
|
+
function shallowCopyObject(obj) {
|
|
503
|
+
var ret = {};
|
|
504
|
+
for (var i in obj) {
|
|
505
|
+
ret[i] = obj[i];
|
|
506
|
+
}
|
|
507
|
+
return ret;
|
|
508
|
+
}
|
|
509
|
+
function FilterCSS(options) {
|
|
510
|
+
options = shallowCopyObject(options || {});
|
|
511
|
+
options.whiteList = options.whiteList || DEFAULT.whiteList;
|
|
512
|
+
options.onAttr = options.onAttr || DEFAULT.onAttr;
|
|
513
|
+
options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT.onIgnoreAttr;
|
|
514
|
+
options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
|
|
515
|
+
this.options = options;
|
|
516
|
+
}
|
|
517
|
+
FilterCSS.prototype.process = function(css) {
|
|
518
|
+
css = css || "";
|
|
519
|
+
css = css.toString();
|
|
520
|
+
if (!css)
|
|
521
|
+
return "";
|
|
522
|
+
var me = this;
|
|
523
|
+
var options = me.options;
|
|
524
|
+
var whiteList = options.whiteList;
|
|
525
|
+
var onAttr = options.onAttr;
|
|
526
|
+
var onIgnoreAttr = options.onIgnoreAttr;
|
|
527
|
+
var safeAttrValue = options.safeAttrValue;
|
|
528
|
+
var retCSS = parseStyle(css, function(sourcePosition, position, name, value, source) {
|
|
529
|
+
var check = whiteList[name];
|
|
530
|
+
var isWhite = false;
|
|
531
|
+
if (check === true)
|
|
532
|
+
isWhite = check;
|
|
533
|
+
else if (typeof check === "function")
|
|
534
|
+
isWhite = check(value);
|
|
535
|
+
else if (check instanceof RegExp)
|
|
536
|
+
isWhite = check.test(value);
|
|
537
|
+
if (isWhite !== true)
|
|
538
|
+
isWhite = false;
|
|
539
|
+
value = safeAttrValue(name, value);
|
|
540
|
+
if (!value)
|
|
541
|
+
return;
|
|
542
|
+
var opts = {
|
|
543
|
+
position,
|
|
544
|
+
sourcePosition,
|
|
545
|
+
source,
|
|
546
|
+
isWhite
|
|
547
|
+
};
|
|
548
|
+
if (isWhite) {
|
|
549
|
+
var ret = onAttr(name, value, opts);
|
|
550
|
+
if (isNull(ret)) {
|
|
551
|
+
return name + ":" + value;
|
|
552
|
+
} else {
|
|
553
|
+
return ret;
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
var ret = onIgnoreAttr(name, value, opts);
|
|
557
|
+
if (!isNull(ret)) {
|
|
558
|
+
return ret;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
return retCSS;
|
|
563
|
+
};
|
|
564
|
+
module.exports = FilterCSS;
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
// node_modules/cssfilter/lib/index.js
|
|
568
|
+
var require_lib = __commonJS(function(exports, module) {
|
|
569
|
+
var DEFAULT = require_default();
|
|
570
|
+
var FilterCSS = require_css();
|
|
571
|
+
function filterCSS(html, options) {
|
|
572
|
+
var xss = new FilterCSS(options);
|
|
573
|
+
return xss.process(html);
|
|
574
|
+
}
|
|
575
|
+
exports = module.exports = filterCSS;
|
|
576
|
+
exports.FilterCSS = FilterCSS;
|
|
577
|
+
for (i in DEFAULT)
|
|
578
|
+
exports[i] = DEFAULT[i];
|
|
579
|
+
var i;
|
|
580
|
+
if (typeof window !== "undefined") {
|
|
581
|
+
window.filterCSS = module.exports;
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
// node_modules/xss/lib/util.js
|
|
586
|
+
var require_util2 = __commonJS(function(exports, module) {
|
|
587
|
+
module.exports = {
|
|
588
|
+
indexOf: function(arr, item) {
|
|
589
|
+
var i, j;
|
|
590
|
+
if (Array.prototype.indexOf) {
|
|
591
|
+
return arr.indexOf(item);
|
|
592
|
+
}
|
|
593
|
+
for (i = 0, j = arr.length;i < j; i++) {
|
|
594
|
+
if (arr[i] === item) {
|
|
595
|
+
return i;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
return -1;
|
|
599
|
+
},
|
|
600
|
+
forEach: function(arr, fn, scope) {
|
|
601
|
+
var i, j;
|
|
602
|
+
if (Array.prototype.forEach) {
|
|
603
|
+
return arr.forEach(fn, scope);
|
|
604
|
+
}
|
|
605
|
+
for (i = 0, j = arr.length;i < j; i++) {
|
|
606
|
+
fn.call(scope, arr[i], i, arr);
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
trim: function(str) {
|
|
610
|
+
if (String.prototype.trim) {
|
|
611
|
+
return str.trim();
|
|
612
|
+
}
|
|
613
|
+
return str.replace(/(^\s*)|(\s*$)/g, "");
|
|
614
|
+
},
|
|
615
|
+
spaceIndex: function(str) {
|
|
616
|
+
var reg = /\s|\n|\t/;
|
|
617
|
+
var match = reg.exec(str);
|
|
618
|
+
return match ? match.index : -1;
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
// node_modules/xss/lib/default.js
|
|
624
|
+
var require_default2 = __commonJS(function(exports) {
|
|
625
|
+
var FilterCSS = require_lib().FilterCSS;
|
|
626
|
+
var getDefaultCSSWhiteList = require_lib().getDefaultWhiteList;
|
|
627
|
+
var _ = require_util2();
|
|
628
|
+
function getDefaultWhiteList() {
|
|
629
|
+
return {
|
|
630
|
+
a: ["target", "href", "title"],
|
|
631
|
+
abbr: ["title"],
|
|
632
|
+
address: [],
|
|
633
|
+
area: ["shape", "coords", "href", "alt"],
|
|
634
|
+
article: [],
|
|
635
|
+
aside: [],
|
|
636
|
+
audio: [
|
|
637
|
+
"autoplay",
|
|
638
|
+
"controls",
|
|
639
|
+
"crossorigin",
|
|
640
|
+
"loop",
|
|
641
|
+
"muted",
|
|
642
|
+
"preload",
|
|
643
|
+
"src"
|
|
644
|
+
],
|
|
645
|
+
b: [],
|
|
646
|
+
bdi: ["dir"],
|
|
647
|
+
bdo: ["dir"],
|
|
648
|
+
big: [],
|
|
649
|
+
blockquote: ["cite"],
|
|
650
|
+
br: [],
|
|
651
|
+
caption: [],
|
|
652
|
+
center: [],
|
|
653
|
+
cite: [],
|
|
654
|
+
code: [],
|
|
655
|
+
col: ["align", "valign", "span", "width"],
|
|
656
|
+
colgroup: ["align", "valign", "span", "width"],
|
|
657
|
+
dd: [],
|
|
658
|
+
del: ["datetime"],
|
|
659
|
+
details: ["open"],
|
|
660
|
+
div: [],
|
|
661
|
+
dl: [],
|
|
662
|
+
dt: [],
|
|
663
|
+
em: [],
|
|
664
|
+
figcaption: [],
|
|
665
|
+
figure: [],
|
|
666
|
+
font: ["color", "size", "face"],
|
|
667
|
+
footer: [],
|
|
668
|
+
h1: [],
|
|
669
|
+
h2: [],
|
|
670
|
+
h3: [],
|
|
671
|
+
h4: [],
|
|
672
|
+
h5: [],
|
|
673
|
+
h6: [],
|
|
674
|
+
header: [],
|
|
675
|
+
hr: [],
|
|
676
|
+
i: [],
|
|
677
|
+
img: ["src", "alt", "title", "width", "height", "loading"],
|
|
678
|
+
ins: ["datetime"],
|
|
679
|
+
kbd: [],
|
|
680
|
+
li: [],
|
|
681
|
+
mark: [],
|
|
682
|
+
nav: [],
|
|
683
|
+
ol: [],
|
|
684
|
+
p: [],
|
|
685
|
+
pre: [],
|
|
686
|
+
s: [],
|
|
687
|
+
section: [],
|
|
688
|
+
small: [],
|
|
689
|
+
span: [],
|
|
690
|
+
sub: [],
|
|
691
|
+
summary: [],
|
|
692
|
+
sup: [],
|
|
693
|
+
strong: [],
|
|
694
|
+
strike: [],
|
|
695
|
+
table: ["width", "border", "align", "valign"],
|
|
696
|
+
tbody: ["align", "valign"],
|
|
697
|
+
td: ["width", "rowspan", "colspan", "align", "valign"],
|
|
698
|
+
tfoot: ["align", "valign"],
|
|
699
|
+
th: ["width", "rowspan", "colspan", "align", "valign"],
|
|
700
|
+
thead: ["align", "valign"],
|
|
701
|
+
tr: ["rowspan", "align", "valign"],
|
|
702
|
+
tt: [],
|
|
703
|
+
u: [],
|
|
704
|
+
ul: [],
|
|
705
|
+
video: [
|
|
706
|
+
"autoplay",
|
|
707
|
+
"controls",
|
|
708
|
+
"crossorigin",
|
|
709
|
+
"loop",
|
|
710
|
+
"muted",
|
|
711
|
+
"playsinline",
|
|
712
|
+
"poster",
|
|
713
|
+
"preload",
|
|
714
|
+
"src",
|
|
715
|
+
"height",
|
|
716
|
+
"width"
|
|
717
|
+
]
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
var defaultCSSFilter = new FilterCSS;
|
|
721
|
+
function onTag(tag, html, options) {}
|
|
722
|
+
function onIgnoreTag(tag, html, options) {}
|
|
723
|
+
function onTagAttr(tag, name, value) {}
|
|
724
|
+
function onIgnoreTagAttr(tag, name, value) {}
|
|
725
|
+
function escapeHtml(html) {
|
|
726
|
+
return html.replace(REGEXP_LT, "<").replace(REGEXP_GT, ">");
|
|
727
|
+
}
|
|
728
|
+
function safeAttrValue(tag, name, value, cssFilter) {
|
|
729
|
+
value = friendlyAttrValue(value);
|
|
730
|
+
if (name === "href" || name === "src") {
|
|
731
|
+
value = _.trim(value);
|
|
732
|
+
if (value === "#")
|
|
733
|
+
return "#";
|
|
734
|
+
if (!(value.substr(0, 7) === "http://" || value.substr(0, 8) === "https://" || value.substr(0, 7) === "mailto:" || value.substr(0, 4) === "tel:" || value.substr(0, 11) === "data:image/" || value.substr(0, 6) === "ftp://" || value.substr(0, 2) === "./" || value.substr(0, 3) === "../" || value[0] === "#" || value[0] === "/")) {
|
|
735
|
+
return "";
|
|
736
|
+
}
|
|
737
|
+
} else if (name === "action" || name === "formaction") {
|
|
738
|
+
value = _.trim(value);
|
|
739
|
+
if (!/^https?:\/\//i.test(value) && /^[^/?#]*:/.test(value)) {
|
|
740
|
+
return "";
|
|
741
|
+
}
|
|
742
|
+
} else if (name === "background") {
|
|
743
|
+
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
|
|
744
|
+
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
|
|
745
|
+
return "";
|
|
746
|
+
}
|
|
747
|
+
} else if (name === "style") {
|
|
748
|
+
REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
|
|
749
|
+
if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {
|
|
750
|
+
return "";
|
|
751
|
+
}
|
|
752
|
+
REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
|
|
753
|
+
if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
|
|
754
|
+
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
|
|
755
|
+
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
|
|
756
|
+
return "";
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if (cssFilter !== false) {
|
|
760
|
+
cssFilter = cssFilter || defaultCSSFilter;
|
|
761
|
+
value = cssFilter.process(value);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
value = escapeAttrValue(value);
|
|
765
|
+
return value;
|
|
766
|
+
}
|
|
767
|
+
var REGEXP_LT = /</g;
|
|
768
|
+
var REGEXP_GT = />/g;
|
|
769
|
+
var REGEXP_QUOTE = /"/g;
|
|
770
|
+
var REGEXP_QUOTE_2 = /"/g;
|
|
771
|
+
var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
|
|
772
|
+
var REGEXP_ATTR_VALUE_COLON = /:?/gim;
|
|
773
|
+
var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
|
|
774
|
+
var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi;
|
|
775
|
+
var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
|
|
776
|
+
var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
|
|
777
|
+
function escapeQuote(str) {
|
|
778
|
+
return str.replace(REGEXP_QUOTE, """);
|
|
779
|
+
}
|
|
780
|
+
function unescapeQuote(str) {
|
|
781
|
+
return str.replace(REGEXP_QUOTE_2, '"');
|
|
782
|
+
}
|
|
783
|
+
function escapeHtmlEntities(str) {
|
|
784
|
+
return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {
|
|
785
|
+
return code[0] === "x" || code[0] === "X" ? String.fromCharCode(parseInt(code.substr(1), 16)) : String.fromCharCode(parseInt(code, 10));
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
function escapeDangerHtml5Entities(str) {
|
|
789
|
+
return str.replace(REGEXP_ATTR_VALUE_COLON, ":").replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
|
|
790
|
+
}
|
|
791
|
+
function clearNonPrintableCharacter(str) {
|
|
792
|
+
var str2 = "";
|
|
793
|
+
for (var i = 0, len = str.length;i < len; i++) {
|
|
794
|
+
str2 += str.charCodeAt(i) < 32 ? " " : str.charAt(i);
|
|
795
|
+
}
|
|
796
|
+
return _.trim(str2);
|
|
797
|
+
}
|
|
798
|
+
function friendlyAttrValue(str) {
|
|
799
|
+
str = unescapeQuote(str);
|
|
800
|
+
str = escapeHtmlEntities(str);
|
|
801
|
+
str = escapeDangerHtml5Entities(str);
|
|
802
|
+
str = clearNonPrintableCharacter(str);
|
|
803
|
+
return str;
|
|
804
|
+
}
|
|
805
|
+
function escapeAttrValue(str) {
|
|
806
|
+
str = escapeQuote(str);
|
|
807
|
+
str = escapeHtml(str);
|
|
808
|
+
return str;
|
|
809
|
+
}
|
|
810
|
+
function onIgnoreTagStripAll() {
|
|
811
|
+
return "";
|
|
812
|
+
}
|
|
813
|
+
function StripTagBody(tags, next) {
|
|
814
|
+
if (typeof next !== "function") {
|
|
815
|
+
next = function() {};
|
|
816
|
+
}
|
|
817
|
+
var isRemoveAllTag = !Array.isArray(tags);
|
|
818
|
+
function isRemoveTag(tag) {
|
|
819
|
+
if (isRemoveAllTag)
|
|
820
|
+
return true;
|
|
821
|
+
return _.indexOf(tags, tag) !== -1;
|
|
822
|
+
}
|
|
823
|
+
var removeList = [];
|
|
824
|
+
var posStart = false;
|
|
825
|
+
return {
|
|
826
|
+
onIgnoreTag: function(tag, html, options) {
|
|
827
|
+
if (isRemoveTag(tag)) {
|
|
828
|
+
if (options.isClosing) {
|
|
829
|
+
var ret = "[/removed]";
|
|
830
|
+
var end = options.position + ret.length;
|
|
831
|
+
removeList.push([
|
|
832
|
+
posStart !== false ? posStart : options.position,
|
|
833
|
+
end
|
|
834
|
+
]);
|
|
835
|
+
posStart = false;
|
|
836
|
+
return ret;
|
|
837
|
+
} else {
|
|
838
|
+
if (!posStart) {
|
|
839
|
+
posStart = options.position;
|
|
840
|
+
}
|
|
841
|
+
return "[removed]";
|
|
842
|
+
}
|
|
843
|
+
} else {
|
|
844
|
+
return next(tag, html, options);
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
remove: function(html) {
|
|
848
|
+
var rethtml = "";
|
|
849
|
+
var lastPos = 0;
|
|
850
|
+
_.forEach(removeList, function(pos) {
|
|
851
|
+
rethtml += html.slice(lastPos, pos[0]);
|
|
852
|
+
lastPos = pos[1];
|
|
853
|
+
});
|
|
854
|
+
rethtml += html.slice(lastPos);
|
|
855
|
+
return rethtml;
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
function stripCommentTag(html) {
|
|
860
|
+
var retHtml = "";
|
|
861
|
+
var lastPos = 0;
|
|
862
|
+
while (lastPos < html.length) {
|
|
863
|
+
var i = html.indexOf("<!--", lastPos);
|
|
864
|
+
if (i === -1) {
|
|
865
|
+
retHtml += html.slice(lastPos);
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
retHtml += html.slice(lastPos, i);
|
|
869
|
+
var j = html.indexOf("-->", i);
|
|
870
|
+
if (j === -1) {
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
lastPos = j + 3;
|
|
874
|
+
}
|
|
875
|
+
return retHtml;
|
|
876
|
+
}
|
|
877
|
+
function stripBlankChar(html) {
|
|
878
|
+
var chars = html.split("");
|
|
879
|
+
chars = chars.filter(function(char) {
|
|
880
|
+
var c = char.charCodeAt(0);
|
|
881
|
+
if (c === 127)
|
|
882
|
+
return false;
|
|
883
|
+
if (c <= 31) {
|
|
884
|
+
if (c === 10 || c === 13)
|
|
885
|
+
return true;
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
return true;
|
|
889
|
+
});
|
|
890
|
+
return chars.join("");
|
|
891
|
+
}
|
|
892
|
+
exports.whiteList = getDefaultWhiteList();
|
|
893
|
+
exports.getDefaultWhiteList = getDefaultWhiteList;
|
|
894
|
+
exports.onTag = onTag;
|
|
895
|
+
exports.onIgnoreTag = onIgnoreTag;
|
|
896
|
+
exports.onTagAttr = onTagAttr;
|
|
897
|
+
exports.onIgnoreTagAttr = onIgnoreTagAttr;
|
|
898
|
+
exports.safeAttrValue = safeAttrValue;
|
|
899
|
+
exports.escapeHtml = escapeHtml;
|
|
900
|
+
exports.escapeQuote = escapeQuote;
|
|
901
|
+
exports.unescapeQuote = unescapeQuote;
|
|
902
|
+
exports.escapeHtmlEntities = escapeHtmlEntities;
|
|
903
|
+
exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
|
|
904
|
+
exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
|
|
905
|
+
exports.friendlyAttrValue = friendlyAttrValue;
|
|
906
|
+
exports.escapeAttrValue = escapeAttrValue;
|
|
907
|
+
exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
|
|
908
|
+
exports.StripTagBody = StripTagBody;
|
|
909
|
+
exports.stripCommentTag = stripCommentTag;
|
|
910
|
+
exports.stripBlankChar = stripBlankChar;
|
|
911
|
+
exports.attributeWrapSign = '"';
|
|
912
|
+
exports.cssFilter = defaultCSSFilter;
|
|
913
|
+
exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
// node_modules/xss/lib/parser.js
|
|
917
|
+
var require_parser2 = __commonJS(function(exports) {
|
|
918
|
+
var _ = require_util2();
|
|
919
|
+
function getTagName(html) {
|
|
920
|
+
var i = _.spaceIndex(html);
|
|
921
|
+
var tagName;
|
|
922
|
+
if (i === -1) {
|
|
923
|
+
tagName = html.slice(1, -1);
|
|
924
|
+
} else {
|
|
925
|
+
tagName = html.slice(1, i + 1);
|
|
926
|
+
}
|
|
927
|
+
tagName = _.trim(tagName).toLowerCase();
|
|
928
|
+
if (tagName.slice(0, 1) === "/")
|
|
929
|
+
tagName = tagName.slice(1);
|
|
930
|
+
if (tagName.slice(-1) === "/")
|
|
931
|
+
tagName = tagName.slice(0, -1);
|
|
932
|
+
return tagName;
|
|
933
|
+
}
|
|
934
|
+
function isClosing(html) {
|
|
935
|
+
return html.slice(0, 2) === "</";
|
|
936
|
+
}
|
|
937
|
+
function parseTag(html, onTag, escapeHtml) {
|
|
938
|
+
var rethtml = "";
|
|
939
|
+
var lastPos = 0;
|
|
940
|
+
var tagStart = false;
|
|
941
|
+
var quoteStart = false;
|
|
942
|
+
var currentPos = 0;
|
|
943
|
+
var len = html.length;
|
|
944
|
+
var currentTagName = "";
|
|
945
|
+
var currentHtml = "";
|
|
946
|
+
chariterator:
|
|
947
|
+
for (currentPos = 0;currentPos < len; currentPos++) {
|
|
948
|
+
var c = html.charAt(currentPos);
|
|
949
|
+
if (tagStart === false) {
|
|
950
|
+
if (c === "<") {
|
|
951
|
+
tagStart = currentPos;
|
|
952
|
+
continue;
|
|
953
|
+
}
|
|
954
|
+
} else {
|
|
955
|
+
if (quoteStart === false) {
|
|
956
|
+
if (c === "<") {
|
|
957
|
+
rethtml += escapeHtml(html.slice(lastPos, currentPos));
|
|
958
|
+
tagStart = currentPos;
|
|
959
|
+
lastPos = currentPos;
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
if (c === ">" || currentPos === len - 1) {
|
|
963
|
+
rethtml += escapeHtml(html.slice(lastPos, tagStart));
|
|
964
|
+
currentHtml = html.slice(tagStart, currentPos + 1);
|
|
965
|
+
currentTagName = getTagName(currentHtml);
|
|
966
|
+
rethtml += onTag(tagStart, rethtml.length, currentTagName, currentHtml, isClosing(currentHtml));
|
|
967
|
+
lastPos = currentPos + 1;
|
|
968
|
+
tagStart = false;
|
|
969
|
+
continue;
|
|
970
|
+
}
|
|
971
|
+
if (c === '"' || c === "'") {
|
|
972
|
+
var i = 1;
|
|
973
|
+
var ic = html.charAt(currentPos - i);
|
|
974
|
+
while (ic.trim() === "" || ic === "=") {
|
|
975
|
+
if (ic === "=") {
|
|
976
|
+
quoteStart = c;
|
|
977
|
+
continue chariterator;
|
|
978
|
+
}
|
|
979
|
+
ic = html.charAt(currentPos - ++i);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
} else {
|
|
983
|
+
if (c === quoteStart) {
|
|
984
|
+
quoteStart = false;
|
|
985
|
+
continue;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if (lastPos < len) {
|
|
991
|
+
rethtml += escapeHtml(html.substr(lastPos));
|
|
992
|
+
}
|
|
993
|
+
return rethtml;
|
|
994
|
+
}
|
|
995
|
+
var REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9\\_:.-]/gim;
|
|
996
|
+
function parseAttr(html, onAttr) {
|
|
997
|
+
var lastPos = 0;
|
|
998
|
+
var lastMarkPos = 0;
|
|
999
|
+
var retAttrs = [];
|
|
1000
|
+
var tmpName = false;
|
|
1001
|
+
var len = html.length;
|
|
1002
|
+
function addAttr(name, value) {
|
|
1003
|
+
name = _.trim(name);
|
|
1004
|
+
name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
|
|
1005
|
+
if (name.length < 1)
|
|
1006
|
+
return;
|
|
1007
|
+
var ret = onAttr(name, value || "");
|
|
1008
|
+
if (ret)
|
|
1009
|
+
retAttrs.push(ret);
|
|
1010
|
+
}
|
|
1011
|
+
for (var i = 0;i < len; i++) {
|
|
1012
|
+
var c = html.charAt(i);
|
|
1013
|
+
var v, j;
|
|
1014
|
+
if (tmpName === false && c === "=") {
|
|
1015
|
+
tmpName = html.slice(lastPos, i);
|
|
1016
|
+
lastPos = i + 1;
|
|
1017
|
+
lastMarkPos = html.charAt(lastPos) === '"' || html.charAt(lastPos) === "'" ? lastPos : findNextQuotationMark(html, i + 1);
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
if (tmpName !== false) {
|
|
1021
|
+
if (i === lastMarkPos) {
|
|
1022
|
+
j = html.indexOf(c, i + 1);
|
|
1023
|
+
if (j === -1) {
|
|
1024
|
+
break;
|
|
1025
|
+
} else {
|
|
1026
|
+
v = _.trim(html.slice(lastMarkPos + 1, j));
|
|
1027
|
+
addAttr(tmpName, v);
|
|
1028
|
+
tmpName = false;
|
|
1029
|
+
i = j;
|
|
1030
|
+
lastPos = i + 1;
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
if (/\s|\n|\t/.test(c)) {
|
|
1036
|
+
html = html.replace(/\s|\n|\t/g, " ");
|
|
1037
|
+
if (tmpName === false) {
|
|
1038
|
+
j = findNextEqual(html, i);
|
|
1039
|
+
if (j === -1) {
|
|
1040
|
+
v = _.trim(html.slice(lastPos, i));
|
|
1041
|
+
addAttr(v);
|
|
1042
|
+
tmpName = false;
|
|
1043
|
+
lastPos = i + 1;
|
|
1044
|
+
continue;
|
|
1045
|
+
} else {
|
|
1046
|
+
i = j - 1;
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
1049
|
+
} else {
|
|
1050
|
+
j = findBeforeEqual(html, i - 1);
|
|
1051
|
+
if (j === -1) {
|
|
1052
|
+
v = _.trim(html.slice(lastPos, i));
|
|
1053
|
+
v = stripQuoteWrap(v);
|
|
1054
|
+
addAttr(tmpName, v);
|
|
1055
|
+
tmpName = false;
|
|
1056
|
+
lastPos = i + 1;
|
|
1057
|
+
continue;
|
|
1058
|
+
} else {
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
if (lastPos < html.length) {
|
|
1065
|
+
if (tmpName === false) {
|
|
1066
|
+
addAttr(html.slice(lastPos));
|
|
1067
|
+
} else {
|
|
1068
|
+
addAttr(tmpName, stripQuoteWrap(_.trim(html.slice(lastPos))));
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
return _.trim(retAttrs.join(" "));
|
|
1072
|
+
}
|
|
1073
|
+
function findNextEqual(str, i) {
|
|
1074
|
+
for (;i < str.length; i++) {
|
|
1075
|
+
var c = str[i];
|
|
1076
|
+
if (c === " ")
|
|
1077
|
+
continue;
|
|
1078
|
+
if (c === "=")
|
|
1079
|
+
return i;
|
|
1080
|
+
return -1;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
function findNextQuotationMark(str, i) {
|
|
1084
|
+
for (;i < str.length; i++) {
|
|
1085
|
+
var c = str[i];
|
|
1086
|
+
if (c === " ")
|
|
1087
|
+
continue;
|
|
1088
|
+
if (c === "'" || c === '"')
|
|
1089
|
+
return i;
|
|
1090
|
+
return -1;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
function findBeforeEqual(str, i) {
|
|
1094
|
+
for (;i > 0; i--) {
|
|
1095
|
+
var c = str[i];
|
|
1096
|
+
if (c === " ")
|
|
1097
|
+
continue;
|
|
1098
|
+
if (c === "=")
|
|
1099
|
+
return i;
|
|
1100
|
+
return -1;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
function isQuoteWrapString(text) {
|
|
1104
|
+
if (text[0] === '"' && text[text.length - 1] === '"' || text[0] === "'" && text[text.length - 1] === "'") {
|
|
1105
|
+
return true;
|
|
1106
|
+
} else {
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
function stripQuoteWrap(text) {
|
|
1111
|
+
if (isQuoteWrapString(text)) {
|
|
1112
|
+
return text.substr(1, text.length - 2);
|
|
1113
|
+
} else {
|
|
1114
|
+
return text;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
exports.parseTag = parseTag;
|
|
1118
|
+
exports.parseAttr = parseAttr;
|
|
1119
|
+
});
|
|
1120
|
+
|
|
1121
|
+
// node_modules/xss/lib/xss.js
|
|
1122
|
+
var require_xss = __commonJS(function(exports, module) {
|
|
1123
|
+
var FilterCSS = require_lib().FilterCSS;
|
|
1124
|
+
var DEFAULT = require_default2();
|
|
1125
|
+
var parser = require_parser2();
|
|
1126
|
+
var parseTag = parser.parseTag;
|
|
1127
|
+
var parseAttr = parser.parseAttr;
|
|
1128
|
+
var _ = require_util2();
|
|
1129
|
+
function isNull(obj) {
|
|
1130
|
+
return obj === undefined || obj === null;
|
|
1131
|
+
}
|
|
1132
|
+
function getAttrs(html) {
|
|
1133
|
+
var i = _.spaceIndex(html);
|
|
1134
|
+
if (i === -1) {
|
|
1135
|
+
return {
|
|
1136
|
+
html: "",
|
|
1137
|
+
closing: html[html.length - 2] === "/"
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
html = _.trim(html.slice(i + 1, -1));
|
|
1141
|
+
var isClosing = html[html.length - 1] === "/";
|
|
1142
|
+
if (isClosing)
|
|
1143
|
+
html = _.trim(html.slice(0, -1));
|
|
1144
|
+
return {
|
|
1145
|
+
html,
|
|
1146
|
+
closing: isClosing
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
function shallowCopyObject(obj) {
|
|
1150
|
+
var ret = {};
|
|
1151
|
+
for (var i in obj) {
|
|
1152
|
+
if (Object.prototype.hasOwnProperty.call(obj, i)) {
|
|
1153
|
+
ret[i] = obj[i];
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
return ret;
|
|
1157
|
+
}
|
|
1158
|
+
function keysToLowerCase(obj) {
|
|
1159
|
+
var ret = {};
|
|
1160
|
+
for (var i in obj) {
|
|
1161
|
+
if (Object.prototype.hasOwnProperty.call(obj, i)) {
|
|
1162
|
+
if (Array.isArray(obj[i])) {
|
|
1163
|
+
ret[i.toLowerCase()] = obj[i].map(function(item) {
|
|
1164
|
+
return item.toLowerCase();
|
|
1165
|
+
});
|
|
1166
|
+
} else {
|
|
1167
|
+
ret[i.toLowerCase()] = obj[i];
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
return ret;
|
|
1172
|
+
}
|
|
1173
|
+
function ownFunction(options, key, fallback) {
|
|
1174
|
+
if (Object.prototype.hasOwnProperty.call(options, key) && typeof options[key] === "function") {
|
|
1175
|
+
return options[key];
|
|
1176
|
+
}
|
|
1177
|
+
return fallback;
|
|
1178
|
+
}
|
|
1179
|
+
function ownProvided(options, key) {
|
|
1180
|
+
if (!Object.prototype.hasOwnProperty.call(options, key)) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
if (options[key] === undefined || options[key] === null) {
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
return options[key];
|
|
1187
|
+
}
|
|
1188
|
+
function FilterXSS(options) {
|
|
1189
|
+
options = shallowCopyObject(options || {});
|
|
1190
|
+
if (Object.prototype.hasOwnProperty.call(options, "stripIgnoreTag") && options.stripIgnoreTag) {
|
|
1191
|
+
if (Object.prototype.hasOwnProperty.call(options, "onIgnoreTag") && options.onIgnoreTag) {
|
|
1192
|
+
console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time');
|
|
1193
|
+
}
|
|
1194
|
+
options.onIgnoreTag = DEFAULT.onIgnoreTagStripAll;
|
|
1195
|
+
}
|
|
1196
|
+
var wl = ownProvided(options, "whiteList");
|
|
1197
|
+
if (wl === undefined) {
|
|
1198
|
+
wl = ownProvided(options, "allowList");
|
|
1199
|
+
}
|
|
1200
|
+
if (wl === undefined) {
|
|
1201
|
+
options.whiteList = DEFAULT.whiteList;
|
|
1202
|
+
} else {
|
|
1203
|
+
options.whiteList = keysToLowerCase(wl);
|
|
1204
|
+
}
|
|
1205
|
+
this.attributeWrapSign = Object.prototype.hasOwnProperty.call(options, "singleQuotedAttributeValue") && options.singleQuotedAttributeValue === true ? "'" : DEFAULT.attributeWrapSign;
|
|
1206
|
+
options.onTag = ownFunction(options, "onTag", DEFAULT.onTag);
|
|
1207
|
+
options.onTagAttr = ownFunction(options, "onTagAttr", DEFAULT.onTagAttr);
|
|
1208
|
+
options.onIgnoreTag = ownFunction(options, "onIgnoreTag", DEFAULT.onIgnoreTag);
|
|
1209
|
+
options.onIgnoreTagAttr = ownFunction(options, "onIgnoreTagAttr", DEFAULT.onIgnoreTagAttr);
|
|
1210
|
+
options.safeAttrValue = ownFunction(options, "safeAttrValue", DEFAULT.safeAttrValue);
|
|
1211
|
+
options.escapeHtml = ownFunction(options, "escapeHtml", DEFAULT.escapeHtml);
|
|
1212
|
+
this.options = options;
|
|
1213
|
+
if (Object.prototype.hasOwnProperty.call(options, "css") && options.css === false) {
|
|
1214
|
+
this.cssFilter = false;
|
|
1215
|
+
} else {
|
|
1216
|
+
options.css = Object.prototype.hasOwnProperty.call(options, "css") ? options.css : {};
|
|
1217
|
+
this.cssFilter = new FilterCSS(options.css);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
FilterXSS.prototype.process = function(html) {
|
|
1221
|
+
html = html || "";
|
|
1222
|
+
html = html.toString();
|
|
1223
|
+
if (!html)
|
|
1224
|
+
return "";
|
|
1225
|
+
var me = this;
|
|
1226
|
+
var options = me.options;
|
|
1227
|
+
var whiteList = options.whiteList;
|
|
1228
|
+
var onTag = options.onTag;
|
|
1229
|
+
var onIgnoreTag = options.onIgnoreTag;
|
|
1230
|
+
var onTagAttr = options.onTagAttr;
|
|
1231
|
+
var onIgnoreTagAttr = options.onIgnoreTagAttr;
|
|
1232
|
+
var safeAttrValue = options.safeAttrValue;
|
|
1233
|
+
var escapeHtml = options.escapeHtml;
|
|
1234
|
+
var attributeWrapSign = me.attributeWrapSign;
|
|
1235
|
+
var cssFilter = me.cssFilter;
|
|
1236
|
+
if (options.stripBlankChar) {
|
|
1237
|
+
html = DEFAULT.stripBlankChar(html);
|
|
1238
|
+
}
|
|
1239
|
+
if (!options.allowCommentTag) {
|
|
1240
|
+
html = DEFAULT.stripCommentTag(html);
|
|
1241
|
+
}
|
|
1242
|
+
var stripIgnoreTagBody = false;
|
|
1243
|
+
if (options.stripIgnoreTagBody) {
|
|
1244
|
+
stripIgnoreTagBody = DEFAULT.StripTagBody(options.stripIgnoreTagBody, onIgnoreTag);
|
|
1245
|
+
onIgnoreTag = stripIgnoreTagBody.onIgnoreTag;
|
|
1246
|
+
}
|
|
1247
|
+
var retHtml = parseTag(html, function(sourcePosition, position, tag, html, isClosing) {
|
|
1248
|
+
var info = {
|
|
1249
|
+
sourcePosition,
|
|
1250
|
+
position,
|
|
1251
|
+
isClosing,
|
|
1252
|
+
isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag)
|
|
1253
|
+
};
|
|
1254
|
+
var ret = onTag(tag, html, info);
|
|
1255
|
+
if (!isNull(ret))
|
|
1256
|
+
return ret;
|
|
1257
|
+
if (info.isWhite) {
|
|
1258
|
+
if (info.isClosing) {
|
|
1259
|
+
return "</" + tag + ">";
|
|
1260
|
+
}
|
|
1261
|
+
var attrs = getAttrs(html);
|
|
1262
|
+
var whiteAttrList = whiteList[tag];
|
|
1263
|
+
var attrsHtml = parseAttr(attrs.html, function(name, value) {
|
|
1264
|
+
var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;
|
|
1265
|
+
var ret = onTagAttr(tag, name, value, isWhiteAttr);
|
|
1266
|
+
if (!isNull(ret))
|
|
1267
|
+
return ret;
|
|
1268
|
+
if (isWhiteAttr) {
|
|
1269
|
+
value = safeAttrValue(tag, name, value, cssFilter);
|
|
1270
|
+
if (value) {
|
|
1271
|
+
return name + "=" + attributeWrapSign + value + attributeWrapSign;
|
|
1272
|
+
} else {
|
|
1273
|
+
return name;
|
|
1274
|
+
}
|
|
1275
|
+
} else {
|
|
1276
|
+
ret = onIgnoreTagAttr(tag, name, value, isWhiteAttr);
|
|
1277
|
+
if (!isNull(ret))
|
|
1278
|
+
return ret;
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
html = "<" + tag;
|
|
1283
|
+
if (attrsHtml)
|
|
1284
|
+
html += " " + attrsHtml;
|
|
1285
|
+
if (attrs.closing)
|
|
1286
|
+
html += " /";
|
|
1287
|
+
html += ">";
|
|
1288
|
+
return html;
|
|
1289
|
+
} else {
|
|
1290
|
+
ret = onIgnoreTag(tag, html, info);
|
|
1291
|
+
if (!isNull(ret))
|
|
1292
|
+
return ret;
|
|
1293
|
+
return escapeHtml(html);
|
|
1294
|
+
}
|
|
1295
|
+
}, escapeHtml);
|
|
1296
|
+
if (stripIgnoreTagBody) {
|
|
1297
|
+
retHtml = stripIgnoreTagBody.remove(retHtml);
|
|
1298
|
+
}
|
|
1299
|
+
return retHtml;
|
|
1300
|
+
};
|
|
1301
|
+
module.exports = FilterXSS;
|
|
1302
|
+
});
|
|
1303
|
+
|
|
1304
|
+
// node_modules/xss/lib/index.js
|
|
1305
|
+
var require_lib2 = __commonJS(function(exports, module) {
|
|
1306
|
+
var DEFAULT = require_default2();
|
|
1307
|
+
var parser = require_parser2();
|
|
1308
|
+
var FilterXSS = require_xss();
|
|
1309
|
+
function filterXSS(html, options) {
|
|
1310
|
+
var xss = new FilterXSS(options);
|
|
1311
|
+
return xss.process(html);
|
|
1312
|
+
}
|
|
1313
|
+
function filterXSSWithResult(html, options) {
|
|
1314
|
+
var removed = [];
|
|
1315
|
+
var opts = {};
|
|
1316
|
+
if (options) {
|
|
1317
|
+
for (var key in options) {
|
|
1318
|
+
if (Object.prototype.hasOwnProperty.call(options, key)) {
|
|
1319
|
+
opts[key] = options[key];
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
var originalOnIgnoreTag = opts.onIgnoreTag;
|
|
1324
|
+
var originalOnIgnoreTagAttr = opts.onIgnoreTagAttr;
|
|
1325
|
+
opts.onIgnoreTag = function(tag, tagHtml, tagOptions) {
|
|
1326
|
+
removed.push({
|
|
1327
|
+
type: "tag",
|
|
1328
|
+
tag,
|
|
1329
|
+
html: tagHtml,
|
|
1330
|
+
isClosing: !!(tagOptions && tagOptions.isClosing)
|
|
1331
|
+
});
|
|
1332
|
+
if (originalOnIgnoreTag) {
|
|
1333
|
+
return originalOnIgnoreTag(tag, tagHtml, tagOptions);
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
opts.onIgnoreTagAttr = function(tag, name, value, isWhiteAttr) {
|
|
1337
|
+
removed.push({
|
|
1338
|
+
type: "attr",
|
|
1339
|
+
tag,
|
|
1340
|
+
attr: name,
|
|
1341
|
+
value
|
|
1342
|
+
});
|
|
1343
|
+
if (originalOnIgnoreTagAttr) {
|
|
1344
|
+
return originalOnIgnoreTagAttr(tag, name, value, isWhiteAttr);
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
var cleanHtml = filterXSS(html, opts);
|
|
1348
|
+
return {
|
|
1349
|
+
html: cleanHtml,
|
|
1350
|
+
removed
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
exports = module.exports = filterXSS;
|
|
1354
|
+
exports.filterXSS = filterXSS;
|
|
1355
|
+
exports.filterXSSWithResult = filterXSSWithResult;
|
|
1356
|
+
exports.FilterXSS = FilterXSS;
|
|
1357
|
+
(function() {
|
|
1358
|
+
for (var i in DEFAULT) {
|
|
1359
|
+
if (Object.prototype.hasOwnProperty.call(DEFAULT, i)) {
|
|
1360
|
+
exports[i] = DEFAULT[i];
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
for (var j in parser) {
|
|
1364
|
+
if (Object.prototype.hasOwnProperty.call(parser, j)) {
|
|
1365
|
+
exports[j] = parser[j];
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
})();
|
|
1369
|
+
if (typeof window !== "undefined") {
|
|
1370
|
+
window.filterXSS = module.exports;
|
|
1371
|
+
}
|
|
1372
|
+
function isWorkerEnv() {
|
|
1373
|
+
return typeof self !== "undefined" && typeof DedicatedWorkerGlobalScope !== "undefined" && self instanceof DedicatedWorkerGlobalScope;
|
|
1374
|
+
}
|
|
1375
|
+
if (isWorkerEnv()) {
|
|
1376
|
+
self.filterXSS = module.exports;
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
// src/features/rich-text/adapters/inbound/RichTextClient.tsx
|
|
1381
|
+
import React from "react";
|
|
1382
|
+
import {
|
|
1383
|
+
EnrichedText,
|
|
1384
|
+
EnrichedTextInput
|
|
1385
|
+
} from "react-native-enriched-html";
|
|
1386
|
+
|
|
1387
|
+
// src/features/rich-text/utils/resolveRichTextHtmlStyle.ts
|
|
1388
|
+
function resolveRichTextHtmlStyle(theme) {
|
|
1389
|
+
return {
|
|
1390
|
+
h1: { fontSize: theme.typography.headings[1].size, bold: true },
|
|
1391
|
+
h2: { fontSize: theme.typography.headings[2].size, bold: true },
|
|
1392
|
+
h3: { fontSize: theme.typography.headings[3].size, bold: true },
|
|
1393
|
+
h4: { fontSize: theme.typography.headings[4].size, bold: true },
|
|
1394
|
+
h5: { fontSize: theme.typography.headings[5].size, bold: true },
|
|
1395
|
+
h6: { fontSize: theme.typography.headings[6].size, bold: true },
|
|
1396
|
+
a: {
|
|
1397
|
+
color: theme.semantics.action.primary.base,
|
|
1398
|
+
pressColor: theme.semantics.action.primary.hover,
|
|
1399
|
+
textDecorationLine: "underline"
|
|
1400
|
+
},
|
|
1401
|
+
ol: {
|
|
1402
|
+
gapWidth: theme.spacing.s,
|
|
1403
|
+
marginLeft: theme.spacing.l,
|
|
1404
|
+
markerColor: theme.semantics.content.default,
|
|
1405
|
+
markerFontWeight: theme.typography.weights.regular
|
|
1406
|
+
},
|
|
1407
|
+
ul: {
|
|
1408
|
+
bulletColor: theme.semantics.content.default,
|
|
1409
|
+
bulletSize: theme.spacing.xs,
|
|
1410
|
+
gapWidth: theme.spacing.s,
|
|
1411
|
+
marginLeft: theme.spacing.l
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// src/features/rich-text/utils/sanitizeRichTextHtml.ts
|
|
1417
|
+
var import_xss = __toESM(require_lib2(), 1);
|
|
1418
|
+
function sanitizeRichTextHtml(html) {
|
|
1419
|
+
return richTextHtmlSanitizer.process(html);
|
|
1420
|
+
}
|
|
1421
|
+
var alignmentAttributes = ["style"];
|
|
1422
|
+
var richTextHtmlSanitizer = new import_xss.FilterXSS({
|
|
1423
|
+
whiteList: {
|
|
1424
|
+
a: ["href"],
|
|
1425
|
+
b: [],
|
|
1426
|
+
br: [],
|
|
1427
|
+
del: [],
|
|
1428
|
+
em: [],
|
|
1429
|
+
h1: alignmentAttributes,
|
|
1430
|
+
h2: alignmentAttributes,
|
|
1431
|
+
h3: alignmentAttributes,
|
|
1432
|
+
h4: alignmentAttributes,
|
|
1433
|
+
h5: alignmentAttributes,
|
|
1434
|
+
h6: alignmentAttributes,
|
|
1435
|
+
html: [],
|
|
1436
|
+
i: [],
|
|
1437
|
+
li: [],
|
|
1438
|
+
ol: alignmentAttributes,
|
|
1439
|
+
p: alignmentAttributes,
|
|
1440
|
+
s: [],
|
|
1441
|
+
strike: [],
|
|
1442
|
+
strong: [],
|
|
1443
|
+
u: [],
|
|
1444
|
+
ul: alignmentAttributes
|
|
1445
|
+
},
|
|
1446
|
+
css: {
|
|
1447
|
+
whiteList: {
|
|
1448
|
+
"text-align": /^(left|center|right|justify)$/
|
|
1449
|
+
}
|
|
1450
|
+
},
|
|
1451
|
+
stripIgnoreTagBody: ["script", "style"]
|
|
1452
|
+
});
|
|
1453
|
+
|
|
1454
|
+
// src/features/rich-text/adapters/inbound/RichTextClient.tsx
|
|
1455
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1456
|
+
function RichTextClient({
|
|
1457
|
+
html,
|
|
1458
|
+
editable = false,
|
|
1459
|
+
placeholder,
|
|
1460
|
+
onChangeHtml,
|
|
1461
|
+
onLinkPress,
|
|
1462
|
+
interactionPolicy,
|
|
1463
|
+
testID
|
|
1464
|
+
}) {
|
|
1465
|
+
const { theme } = useZoraTheme2();
|
|
1466
|
+
const editorRef = React.useRef(null);
|
|
1467
|
+
const sanitizedHtml = React.useMemo(() => sanitizeRichTextHtml(html), [html]);
|
|
1468
|
+
const currentHtml = React.useRef(sanitizedHtml);
|
|
1469
|
+
const [selection, setSelection] = React.useState({
|
|
1470
|
+
start: 0,
|
|
1471
|
+
end: 0,
|
|
1472
|
+
text: ""
|
|
1473
|
+
});
|
|
1474
|
+
const [linkEditorVisible, setLinkEditorVisible] = React.useState(false);
|
|
1475
|
+
const [linkUrl, setLinkUrl] = React.useState("");
|
|
1476
|
+
const htmlStyle = React.useMemo(() => resolveRichTextHtmlStyle(theme), [theme]);
|
|
1477
|
+
const contentStyle = React.useMemo(() => ({
|
|
1478
|
+
backgroundColor: theme.semantics.surface.default,
|
|
1479
|
+
borderColor: theme.semantics.border.default,
|
|
1480
|
+
borderRadius: theme.radii.l,
|
|
1481
|
+
borderWidth: 1,
|
|
1482
|
+
color: theme.semantics.content.default,
|
|
1483
|
+
fontFamily: theme.typography.fonts.normal[theme.typography.weights.regular],
|
|
1484
|
+
fontSize: theme.typography.sizes.m,
|
|
1485
|
+
lineHeight: 24,
|
|
1486
|
+
padding: theme.spacing.m
|
|
1487
|
+
}), [theme]);
|
|
1488
|
+
const passive = interactionPolicy === "passive";
|
|
1489
|
+
const canEdit = editable && !passive;
|
|
1490
|
+
const handleLinkPress = React.useCallback(({ url }) => {
|
|
1491
|
+
if (!passive)
|
|
1492
|
+
onLinkPress?.(url);
|
|
1493
|
+
}, [onLinkPress, passive]);
|
|
1494
|
+
React.useEffect(() => {
|
|
1495
|
+
if (sanitizedHtml === currentHtml.current)
|
|
1496
|
+
return;
|
|
1497
|
+
editorRef.current?.setValue(sanitizedHtml);
|
|
1498
|
+
currentHtml.current = sanitizedHtml;
|
|
1499
|
+
}, [sanitizedHtml]);
|
|
1500
|
+
if (!editable) {
|
|
1501
|
+
return /* @__PURE__ */ jsx(EnrichedText, {
|
|
1502
|
+
htmlStyle,
|
|
1503
|
+
onLinkPress: onLinkPress === undefined || passive ? undefined : handleLinkPress,
|
|
1504
|
+
selectable: !passive,
|
|
1505
|
+
style: contentStyle,
|
|
1506
|
+
testID,
|
|
1507
|
+
children: sanitizedHtml
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
return /* @__PURE__ */ jsxs(View2, {
|
|
1511
|
+
gap: "s",
|
|
1512
|
+
children: [
|
|
1513
|
+
/* @__PURE__ */ jsx(RichTextToolbar, {
|
|
1514
|
+
disabled: !canEdit,
|
|
1515
|
+
editorRef,
|
|
1516
|
+
linkEditorVisible,
|
|
1517
|
+
onLinkEditorVisibilityChange: setLinkEditorVisible
|
|
1518
|
+
}),
|
|
1519
|
+
linkEditorVisible ? /* @__PURE__ */ jsxs(View2, {
|
|
1520
|
+
align: "center",
|
|
1521
|
+
direction: "row",
|
|
1522
|
+
gap: "s",
|
|
1523
|
+
children: [
|
|
1524
|
+
/* @__PURE__ */ jsx(TextInput2, {
|
|
1525
|
+
disabled: !canEdit,
|
|
1526
|
+
onChangeText: setLinkUrl,
|
|
1527
|
+
placeholder: "https://example.com",
|
|
1528
|
+
size: "m",
|
|
1529
|
+
value: linkUrl
|
|
1530
|
+
}),
|
|
1531
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1532
|
+
color: "primary",
|
|
1533
|
+
disabled: !canEdit || linkUrl.length === 0,
|
|
1534
|
+
icon: { name: "check", provider: "FontAwesome6", variant: "solid" },
|
|
1535
|
+
label: "Apply link",
|
|
1536
|
+
onPress: () => {
|
|
1537
|
+
if (selection.text.length === 0)
|
|
1538
|
+
return;
|
|
1539
|
+
editorRef.current?.setLink(selection.start, selection.end, selection.text, linkUrl);
|
|
1540
|
+
setLinkEditorVisible(false);
|
|
1541
|
+
setLinkUrl("");
|
|
1542
|
+
}
|
|
1543
|
+
})
|
|
1544
|
+
]
|
|
1545
|
+
}) : null,
|
|
1546
|
+
/* @__PURE__ */ jsx(EnrichedTextInput, {
|
|
1547
|
+
cursorColor: theme.semantics.border.focus,
|
|
1548
|
+
defaultValue: sanitizedHtml,
|
|
1549
|
+
editable: canEdit,
|
|
1550
|
+
htmlStyle,
|
|
1551
|
+
onChangeHtml: (event) => {
|
|
1552
|
+
const nextHtml = sanitizeRichTextHtml(event.nativeEvent.value);
|
|
1553
|
+
currentHtml.current = nextHtml;
|
|
1554
|
+
onChangeHtml?.(nextHtml);
|
|
1555
|
+
},
|
|
1556
|
+
onChangeSelection: (event) => setSelection(event.nativeEvent),
|
|
1557
|
+
onLinkPress: onLinkPress === undefined || passive ? undefined : handleLinkPress,
|
|
1558
|
+
placeholder,
|
|
1559
|
+
placeholderTextColor: theme.semantics.content.muted,
|
|
1560
|
+
ref: editorRef,
|
|
1561
|
+
selectionColor: theme.semantics.action.primary.softBg,
|
|
1562
|
+
style: contentStyle,
|
|
1563
|
+
testID
|
|
1564
|
+
})
|
|
1565
|
+
]
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
function RichTextToolbar({
|
|
1569
|
+
disabled,
|
|
1570
|
+
editorRef,
|
|
1571
|
+
linkEditorVisible,
|
|
1572
|
+
onLinkEditorVisibilityChange
|
|
1573
|
+
}) {
|
|
1574
|
+
return /* @__PURE__ */ jsxs(View2, {
|
|
1575
|
+
gap: "s",
|
|
1576
|
+
children: [
|
|
1577
|
+
/* @__PURE__ */ jsxs(Toolbar2, {
|
|
1578
|
+
compact: true,
|
|
1579
|
+
children: [
|
|
1580
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1581
|
+
disabled,
|
|
1582
|
+
icon: { name: "heading", provider: "FontAwesome6", variant: "solid" },
|
|
1583
|
+
label: "Heading level 1",
|
|
1584
|
+
onPress: () => editorRef.current?.toggleH1()
|
|
1585
|
+
}),
|
|
1586
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1587
|
+
disabled,
|
|
1588
|
+
icon: { name: "heading", provider: "FontAwesome6", variant: "solid" },
|
|
1589
|
+
label: "Heading level 2",
|
|
1590
|
+
onPress: () => editorRef.current?.toggleH2()
|
|
1591
|
+
}),
|
|
1592
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1593
|
+
disabled,
|
|
1594
|
+
icon: { name: "heading", provider: "FontAwesome6", variant: "solid" },
|
|
1595
|
+
label: "Heading level 3",
|
|
1596
|
+
onPress: () => editorRef.current?.toggleH3()
|
|
1597
|
+
}),
|
|
1598
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1599
|
+
disabled,
|
|
1600
|
+
icon: { name: "bold", provider: "FontAwesome6", variant: "solid" },
|
|
1601
|
+
label: "Bold",
|
|
1602
|
+
onPress: () => editorRef.current?.toggleBold()
|
|
1603
|
+
}),
|
|
1604
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1605
|
+
disabled,
|
|
1606
|
+
icon: { name: "italic", provider: "FontAwesome6", variant: "solid" },
|
|
1607
|
+
label: "Italic",
|
|
1608
|
+
onPress: () => editorRef.current?.toggleItalic()
|
|
1609
|
+
}),
|
|
1610
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1611
|
+
disabled,
|
|
1612
|
+
icon: { name: "underline", provider: "FontAwesome6", variant: "solid" },
|
|
1613
|
+
label: "Underline",
|
|
1614
|
+
onPress: () => editorRef.current?.toggleUnderline()
|
|
1615
|
+
}),
|
|
1616
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1617
|
+
disabled,
|
|
1618
|
+
icon: { name: "strikethrough", provider: "FontAwesome6", variant: "solid" },
|
|
1619
|
+
label: "Strikethrough",
|
|
1620
|
+
onPress: () => editorRef.current?.toggleStrikeThrough()
|
|
1621
|
+
}),
|
|
1622
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1623
|
+
disabled,
|
|
1624
|
+
icon: { name: "link", provider: "FontAwesome6", variant: "solid" },
|
|
1625
|
+
label: "Link",
|
|
1626
|
+
onPress: () => onLinkEditorVisibilityChange(!linkEditorVisible)
|
|
1627
|
+
})
|
|
1628
|
+
]
|
|
1629
|
+
}),
|
|
1630
|
+
/* @__PURE__ */ jsxs(Toolbar2, {
|
|
1631
|
+
compact: true,
|
|
1632
|
+
children: [
|
|
1633
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1634
|
+
disabled,
|
|
1635
|
+
icon: { name: "list-ol", provider: "FontAwesome6", variant: "solid" },
|
|
1636
|
+
label: "Ordered list",
|
|
1637
|
+
onPress: () => editorRef.current?.toggleOrderedList()
|
|
1638
|
+
}),
|
|
1639
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1640
|
+
disabled,
|
|
1641
|
+
icon: { name: "list-ul", provider: "FontAwesome6", variant: "solid" },
|
|
1642
|
+
label: "Unordered list",
|
|
1643
|
+
onPress: () => editorRef.current?.toggleUnorderedList()
|
|
1644
|
+
}),
|
|
1645
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1646
|
+
disabled,
|
|
1647
|
+
icon: { name: "align-left", provider: "FontAwesome6", variant: "solid" },
|
|
1648
|
+
label: "Align left",
|
|
1649
|
+
onPress: () => editorRef.current?.setTextAlignment("left")
|
|
1650
|
+
}),
|
|
1651
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1652
|
+
disabled,
|
|
1653
|
+
icon: { name: "align-center", provider: "FontAwesome6", variant: "solid" },
|
|
1654
|
+
label: "Align center",
|
|
1655
|
+
onPress: () => editorRef.current?.setTextAlignment("center")
|
|
1656
|
+
}),
|
|
1657
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1658
|
+
disabled,
|
|
1659
|
+
icon: { name: "align-right", provider: "FontAwesome6", variant: "solid" },
|
|
1660
|
+
label: "Align right",
|
|
1661
|
+
onPress: () => editorRef.current?.setTextAlignment("right")
|
|
1662
|
+
}),
|
|
1663
|
+
/* @__PURE__ */ jsx(IconButton2, {
|
|
1664
|
+
disabled,
|
|
1665
|
+
icon: { name: "align-justify", provider: "FontAwesome6", variant: "solid" },
|
|
1666
|
+
label: "Justify",
|
|
1667
|
+
onPress: () => editorRef.current?.setTextAlignment("justify")
|
|
1668
|
+
})
|
|
1669
|
+
]
|
|
1670
|
+
})
|
|
1671
|
+
]
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
export {
|
|
1675
|
+
RichTextClient
|
|
1676
|
+
};
|