@procore/text-editor 0.5.1 → 1.0.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/.jest/ckeditorMock.js +47 -23
- package/CHANGELOG.md +19 -0
- package/README.md +96 -7
- package/dist/TextEditor/CKTextEditor.d.ts +3 -0
- package/dist/TextEditor/CKTextEditor.js +312 -0
- package/dist/TextEditor/CKTextEditor.js.map +1 -0
- package/dist/TextEditor/Providers/FeatureFlagProvider.d.ts +5 -0
- package/dist/TextEditor/Providers/FeatureFlagProvider.js +34 -0
- package/dist/TextEditor/Providers/FeatureFlagProvider.js.map +1 -0
- package/dist/TextEditor/TextEditor.d.ts +1 -1
- package/dist/TextEditor/TextEditor.js +16 -232
- package/dist/TextEditor/TextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.styles.d.ts +14 -1
- package/dist/TextEditor/TextEditor.styles.js +18 -5
- package/dist/TextEditor/TextEditor.styles.js.map +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +82 -1
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditor/TextEditorI18nProvider.d.ts +2 -0
- package/dist/TextEditor/TextEditorI18nProvider.js +27 -0
- package/dist/TextEditor/TextEditorI18nProvider.js.map +1 -0
- package/dist/TextEditor/TinyMCETextEditor.d.ts +3 -0
- package/dist/TextEditor/TinyMCETextEditor.js +63 -0
- package/dist/TextEditor/TinyMCETextEditor.js.map +1 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.d.ts +48 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.js +441 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.js.map +1 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/index.d.ts +1 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/index.js +2 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/index.js.map +1 -0
- package/dist/TextEditor/utils/config.d.ts +6 -1
- package/dist/TextEditor/utils/config.js +23 -9
- package/dist/TextEditor/utils/config.js.map +1 -1
- package/dist/TextEditor/utils/imageAttributes.d.ts +6 -0
- package/dist/TextEditor/utils/imageAttributes.js +17 -0
- package/dist/TextEditor/utils/imageAttributes.js.map +1 -0
- package/dist/TextEditor/utils/imageUrls.d.ts +2 -0
- package/dist/TextEditor/utils/imageUrls.js +36 -0
- package/dist/TextEditor/utils/imageUrls.js.map +1 -0
- package/dist/TextEditor/utils/richTextEditorHandlers.d.ts +9 -0
- package/dist/TextEditor/utils/richTextEditorHandlers.js +234 -0
- package/dist/TextEditor/utils/richTextEditorHandlers.js.map +1 -0
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +2 -2
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.utils.d.ts +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.utils.js +150 -6
- package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +1 -1
- package/dist/_typedoc/TextEditor/TextEditor.types.json +215 -17
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
- package/dist/ckeditor5-premium-features.d.js +2 -0
- package/dist/ckeditor5-premium-features.d.js.map +1 -0
- package/dist/locales/en.json +17 -0
- package/dist/locales/pseudo.json +17 -0
- package/package.json +8 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"richTextEditorHandlers.js","names":["e","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_regeneratorDefine","enumerable","configurable","writable","_invoke","_OverloadYield","k","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","IMAGE_UPLOAD_FAILED_MESSAGE","defaultFetcher","fetch","_ref","require","requestJSON","fetcherRequestJSON","_ref2","_regeneratorRuntime","mark","_callee","fetcher","url","init","response","wrap","_callee$","_context","prev","next","sent","ok","t0","Error","errorMessageFromResponse","t1","json","abrupt","stop","_x","_x2","_x3","procoreRequestJSON","bodyFromResponse","data","_ref3","_callee2","fallbackMessage","_body$error","_body$errors","_body$errors$find","body","_callee2$","_context2","error","message","errors","find","_x4","_x5","richTextEditorEndpoint","_ref4","companyId","projectId","projectPath","concat","uploadEndpoint","_ref5","uploadFileToStorage","_ref6","_callee3","uploadInstructions","file","signal","_uploadInstructions$f","uploadResponse","_callee3$","_context3","uuid","FormData","entries","fields","forEach","_ref7","_ref8","_slicedToArray","key","append","method","_x6","_x7","_x8","_x9","richTextEditorUploadHandler","_ref9","toolName","_ref0","_callee4","context","callbacks","_callbacks$onProgress","_callbacks$onProgress2","createBody","prostoreFileId","urls","_callee4$","_context4","onProgress","size","credentials","headers","JSON","stringify","response_content_type","type","response_filename","name","upload_uuid","filename","tool_name","prostore_file_id","width","height","_x0","_x1","_x10"],"sources":["../../../src/TextEditor/utils/richTextEditorHandlers.ts"],"sourcesContent":["import type {\n TextEditorImageUploadHandlers,\n TextEditorImageUploadResult,\n} from '../TextEditor.types'\n\ntype CreateRichTextEditorUploadResponseBody = {\n prostore_file_id?: number | string\n urls?: TextEditorImageUploadResult['urls']\n width?: number\n height?: number\n}\n\ntype CreateUploadResponseBody = {\n uuid?: string\n url?: string\n fields?: Record<string, string>\n}\n\ntype CreateRichTextEditorUploadResponse =\n | CreateRichTextEditorUploadResponseBody\n | { data: CreateRichTextEditorUploadResponseBody }\n\ntype ErrorResponseBody = {\n error?: {\n message?: string\n }\n errors?: Array<{\n message?: string\n }>\n message?: string\n}\n\ntype RichTextEditorHandlerOptions = {\n companyId: number | string\n projectId?: number | string\n toolName: string\n fetcher?: typeof fetch\n}\n\nconst IMAGE_UPLOAD_FAILED_MESSAGE = 'Image upload failed.'\n\nconst defaultFetcher: typeof fetch = (...args) => fetch(...args)\nconst { requestJSON } = require('@procore/core-http') as {\n requestJSON: <T>(url: string, init?: RequestInit) => Promise<T>\n}\n\nconst fetcherRequestJSON = async <T extends object>(\n fetcher: typeof fetch,\n url: string,\n init: RequestInit\n) => {\n const response = await fetcher(url, init)\n\n if (!response.ok) {\n throw new Error(\n await errorMessageFromResponse(response, IMAGE_UPLOAD_FAILED_MESSAGE)\n )\n }\n\n return (await response.json()) as T\n}\n\nconst procoreRequestJSON = <T extends object>(\n url: string,\n init: RequestInit,\n fetcher?: typeof fetch\n) => {\n if (fetcher) {\n return fetcherRequestJSON<T>(fetcher, url, init)\n }\n\n return requestJSON<T>(url, init)\n}\n\nconst bodyFromResponse = <T extends object>(response: T | { data: T }) =>\n 'data' in response ? response.data : response\n\nconst errorMessageFromResponse = async (\n response: Response,\n fallbackMessage: string\n) => {\n try {\n const body = (await response.json()) as ErrorResponseBody\n\n return (\n body.error?.message ||\n body.errors?.find((error) => error.message)?.message ||\n body.message ||\n fallbackMessage\n )\n } catch (_error) {\n return fallbackMessage\n }\n}\n\nconst richTextEditorEndpoint = ({\n companyId,\n projectId,\n}: {\n companyId: number | string\n projectId?: number | string\n}) => {\n const projectPath = projectId ? `/projects/${projectId}` : ''\n\n return `/rest/v2.0/companies/${companyId}${projectPath}/rich_text_editor/images`\n}\n\nconst uploadEndpoint = ({\n companyId,\n projectId,\n}: {\n companyId: number | string\n projectId?: number | string\n}) => {\n return projectId\n ? `/rest/v1.1/projects/${projectId}/uploads`\n : `/rest/v1.1/companies/${companyId}/uploads`\n}\n\nconst uploadFileToStorage = async (\n uploadInstructions: CreateUploadResponseBody,\n file: File,\n signal: AbortSignal,\n fetcher: typeof fetch\n) => {\n if (!uploadInstructions.uuid || !uploadInstructions.url) {\n throw new Error('Image upload did not return storage instructions.')\n }\n\n const body = new FormData()\n\n Object.entries(uploadInstructions.fields ?? {}).forEach(([key, value]) => {\n body.append(key, value)\n })\n body.append('file', file)\n\n const uploadResponse = await fetcher(uploadInstructions.url, {\n method: 'POST',\n signal,\n body,\n })\n\n if (!uploadResponse.ok) {\n throw new Error(IMAGE_UPLOAD_FAILED_MESSAGE)\n }\n}\n\nexport const richTextEditorUploadHandler = ({\n companyId,\n projectId,\n toolName,\n fetcher,\n}: RichTextEditorHandlerOptions): TextEditorImageUploadHandlers['upload'] => {\n return async (file, context, callbacks) => {\n callbacks.onProgress?.(0, file.size)\n\n const uploadInstructions =\n await procoreRequestJSON<CreateUploadResponseBody>(\n uploadEndpoint({ companyId, projectId }),\n {\n method: 'POST',\n credentials: 'same-origin',\n signal: context.signal,\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n response_content_type: file.type,\n response_filename: file.name,\n size: file.size,\n }),\n },\n fetcher\n )\n\n await uploadFileToStorage(\n uploadInstructions,\n file,\n context.signal,\n fetcher ?? defaultFetcher\n )\n\n const createBody = bodyFromResponse(\n await procoreRequestJSON<CreateRichTextEditorUploadResponse>(\n richTextEditorEndpoint({ companyId, projectId }),\n {\n method: 'POST',\n credentials: 'same-origin',\n signal: context.signal,\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n upload_uuid: uploadInstructions.uuid,\n filename: file.name,\n tool_name: toolName,\n }),\n },\n fetcher\n )\n )\n const prostoreFileId = createBody.prostore_file_id\n const urls = createBody.urls\n\n if (!prostoreFileId || !urls?.default) {\n throw new Error('Image upload did not return a Prostore file ID and URL.')\n }\n\n callbacks.onProgress?.(file.size, file.size)\n\n return {\n urls,\n prostoreFileId,\n width: createBody.width,\n height: createBody.height,\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;0BACA,uKAAAA,CAAA,EAAAC,CAAA,EAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,WA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|
2
2
|
export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
|
|
3
3
|
displayName: "StyledEditor",
|
|
4
|
-
componentId: "text-editor-
|
|
5
|
-
})([".ck-editor__top{height:0 !important;}.ck-content{border:none !important;padding:0 !important;--ck-content-font-family:Inter,'Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC',sans-serif;--ck-content-font-size:14px;--ck-content-word-break:break-word;--ck-content-overflow-wrap:break-word;--ck-content-line-height:1.4;p{margin:0;}img{margin-left:auto;margin-right:auto;}figure.table{display:table;margin-top:0.9em;margin-bottom:0.9em;}figure.table table,table{width:100%;border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;th{text-align:left;}& > thead,& > tbody{& > tr > td,& > tr > th{border:1px solid #bfbfbf;min-width:2em;padding:0.4em;}& > tr > th{background:rgba(0,0,0,0.05);font-weight:700;}}}}"]);
|
|
4
|
+
componentId: "text-editor-1_0_0__sc-1oujb2g-0"
|
|
5
|
+
})([".ck-editor__top{height:0 !important;}.ck-content{border:none !important;padding:0 !important;--ck-content-font-family:Inter,'Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC',sans-serif;--ck-content-font-size:14px;--ck-content-word-break:break-word;--ck-content-overflow-wrap:break-word;--ck-content-line-height:1.4;p{margin:0;}img{margin-left:auto;margin-right:auto;max-width:100%;height:auto;}figure.table{display:table;margin-top:0.9em;margin-bottom:0.9em;}figure.table table,table{width:100%;border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;th{text-align:left;}& > thead,& > tbody{& > tr > td,& > tr > th{border:1px solid #bfbfbf;min-width:2em;padding:0.4em;}& > tr > th{background:rgba(0,0,0,0.05);font-weight:700;}}}}"]);
|
|
6
6
|
//# sourceMappingURL=TextEditorOutput.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/TextEditorOutput/TextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n .ck-editor__top {\n height: 0 !important;\n }\n\n .ck-content {\n border: none !important;\n padding: 0 !important;\n --ck-content-font-family: Inter, 'Noto Sans JP', 'Noto Sans KR',\n 'Noto Sans SC', 'Noto Sans TC', sans-serif;\n --ck-content-font-size: 14px;\n --ck-content-word-break: break-word;\n --ck-content-overflow-wrap: break-word;\n --ck-content-line-height: 1.4;\n\n p {\n margin: 0;\n }\n\n img {\n margin-left: auto;\n margin-right: auto;\n }\n\n figure.table {\n display: table;\n margin-top: 0.9em;\n margin-bottom: 0.9em;\n }\n\n figure.table table,\n table {\n width: 100%;\n border: 1px double #b3b3b3;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n text-align: left;\n }\n\n & > thead,\n & > tbody {\n & > tr > td,\n & > tr > th {\n border: 1px solid #bfbfbf;\n min-width: 2em;\n padding: 0.4em;\n }\n\n & > tr > th {\n background: rgba(0, 0, 0, 0.05);\n font-weight: 700;\n }\n }\n }\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"TextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/TextEditorOutput/TextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n .ck-editor__top {\n height: 0 !important;\n }\n\n .ck-content {\n border: none !important;\n padding: 0 !important;\n --ck-content-font-family: Inter, 'Noto Sans JP', 'Noto Sans KR',\n 'Noto Sans SC', 'Noto Sans TC', sans-serif;\n --ck-content-font-size: 14px;\n --ck-content-word-break: break-word;\n --ck-content-overflow-wrap: break-word;\n --ck-content-line-height: 1.4;\n\n p {\n margin: 0;\n }\n\n img {\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n height: auto;\n }\n\n figure.table {\n display: table;\n margin-top: 0.9em;\n margin-bottom: 0.9em;\n }\n\n figure.table table,\n table {\n width: 100%;\n border: 1px double #b3b3b3;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n text-align: left;\n }\n\n & > thead,\n & > tbody {\n & > tr > td,\n & > tr > th {\n border: 1px solid #bfbfbf;\n min-width: 2em;\n padding: 0.4em;\n }\n\n & > tr > th {\n background: rgba(0, 0, 0, 0.05);\n font-weight: 700;\n }\n }\n }\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,uvBA2DrC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { isAllowedTextEditorImageUrl } from '../TextEditor/utils/imageUrls';
|
|
2
2
|
export declare const sanitizeTextEditorHtml: (html: string) => string;
|
|
@@ -1,16 +1,148 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
10
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
12
|
+
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
18
|
import sanitizeHtml from 'sanitize-html';
|
|
19
|
+
import { RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE } from '../TextEditor/utils/imageAttributes';
|
|
20
|
+
import { canonicalizeTextEditorImageUrl } from '../TextEditor/utils/imageUrls';
|
|
21
|
+
export { isAllowedTextEditorImageUrl } from '../TextEditor/utils/imageUrls';
|
|
22
|
+
var CKEDITOR_IMAGE_CLASSES = new Set(['image', 'image-inline', 'image_resized', 'image-style-align-left', 'image-style-align-right', 'image-style-block-align-left', 'image-style-block-align-right', 'image-style-side']);
|
|
23
|
+
var IMAGE_TAGS = new Set(['figure', 'figcaption', 'picture', 'source', 'img']);
|
|
24
|
+
var sanitizeSrcset = function sanitizeSrcset(srcset) {
|
|
25
|
+
var candidates = srcset.split(',').map(function (candidate) {
|
|
26
|
+
return candidate.trim();
|
|
27
|
+
}).filter(Boolean);
|
|
28
|
+
if (candidates.length === 0) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
var sanitizedCandidates = candidates.map(function (candidate) {
|
|
32
|
+
var _candidate$split = candidate.split(/\s+/),
|
|
33
|
+
_candidate$split2 = _toArray(_candidate$split),
|
|
34
|
+
url = _candidate$split2[0],
|
|
35
|
+
descriptors = _candidate$split2.slice(1);
|
|
36
|
+
var canonicalUrl = canonicalizeTextEditorImageUrl(url);
|
|
37
|
+
if (!canonicalUrl || descriptors.some(function (descriptor) {
|
|
38
|
+
return !/^(?:\d+w|\d+(?:\.\d+)?x)$/.test(descriptor);
|
|
39
|
+
})) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return [canonicalUrl].concat(_toConsumableArray(descriptors)).join(' ');
|
|
43
|
+
});
|
|
44
|
+
if (sanitizedCandidates.includes(undefined)) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return sanitizedCandidates.join(', ');
|
|
48
|
+
};
|
|
49
|
+
var sanitizeImageClass = function sanitizeImageClass(className) {
|
|
50
|
+
var allowedClasses = className === null || className === void 0 ? void 0 : className.split(/\s+/).filter(function (name) {
|
|
51
|
+
return CKEDITOR_IMAGE_CLASSES.has(name);
|
|
52
|
+
});
|
|
53
|
+
return allowedClasses !== null && allowedClasses !== void 0 && allowedClasses.length ? allowedClasses.join(' ') : undefined;
|
|
54
|
+
};
|
|
55
|
+
var sanitizeImageSizes = function sanitizeImageSizes(sizes) {
|
|
56
|
+
if (!sizes || /url\(|javascript:|data:/i.test(sizes)) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
return /^[\w\s().,:+\-/%]+$/.test(sizes) ? sizes : undefined;
|
|
60
|
+
};
|
|
61
|
+
var sanitizeProstoreFileId = function sanitizeProstoreFileId(id) {
|
|
62
|
+
return id && /^[\w-]+$/.test(id) ? id : undefined;
|
|
63
|
+
};
|
|
2
64
|
|
|
3
|
-
|
|
65
|
+
// ImageResize writes inline `width: X%` (and occasionally `height`) on the
|
|
66
|
+
// containing <figure>/<img>. Keep only those declarations so resized images
|
|
67
|
+
// render at the user's chosen size, `allowedStyles` further validates the values.
|
|
68
|
+
var SAFE_IMAGE_STYLE_PROPERTIES = new Set(['width', 'height', 'aspect-ratio']);
|
|
69
|
+
var filterImageStyle = function filterImageStyle(style) {
|
|
70
|
+
if (!style) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
var safeDeclarations = style.split(';').map(function (declaration) {
|
|
74
|
+
return declaration.trim();
|
|
75
|
+
}).filter(Boolean).filter(function (declaration) {
|
|
76
|
+
var _property$trim$toLowe;
|
|
77
|
+
var _declaration$split = declaration.split(':', 1),
|
|
78
|
+
_declaration$split2 = _slicedToArray(_declaration$split, 1),
|
|
79
|
+
property = _declaration$split2[0];
|
|
80
|
+
return SAFE_IMAGE_STYLE_PROPERTIES.has((_property$trim$toLowe = property === null || property === void 0 ? void 0 : property.trim().toLowerCase()) !== null && _property$trim$toLowe !== void 0 ? _property$trim$toLowe : '');
|
|
81
|
+
});
|
|
82
|
+
return safeDeclarations.length ? "".concat(safeDeclarations.join('; '), ";") : undefined;
|
|
83
|
+
};
|
|
84
|
+
var setOrDeleteAttribute = function setOrDeleteAttribute(attributes, name, value) {
|
|
85
|
+
if (value) {
|
|
86
|
+
attributes[name] = value;
|
|
87
|
+
} else {
|
|
88
|
+
delete attributes[name];
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var sanitizeImageTagAttributes = function sanitizeImageTagAttributes(tagName, attributes) {
|
|
92
|
+
if (!IMAGE_TAGS.has(tagName)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
setOrDeleteAttribute(attributes, 'style', filterImageStyle(attributes.style));
|
|
96
|
+
delete attributes.onclick;
|
|
97
|
+
delete attributes.onload;
|
|
98
|
+
};
|
|
99
|
+
var sanitizeClassAttribute = function sanitizeClassAttribute(attributes) {
|
|
100
|
+
setOrDeleteAttribute(attributes, 'class', sanitizeImageClass(attributes["class"]));
|
|
101
|
+
};
|
|
102
|
+
var sanitizeUrlAttribute = function sanitizeUrlAttribute(attributes, name, sanitize) {
|
|
103
|
+
if (attributes[name]) {
|
|
104
|
+
setOrDeleteAttribute(attributes, name, sanitize(attributes[name]));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var sanitizeImageUrlAttributes = function sanitizeImageUrlAttributes(attributes) {
|
|
108
|
+
sanitizeUrlAttribute(attributes, 'src', canonicalizeTextEditorImageUrl);
|
|
109
|
+
sanitizeUrlAttribute(attributes, 'srcset', sanitizeSrcset);
|
|
110
|
+
sanitizeUrlAttribute(attributes, 'sizes', sanitizeImageSizes);
|
|
111
|
+
};
|
|
112
|
+
var sanitizeProstoreFileIdAttribute = function sanitizeProstoreFileIdAttribute(attributes) {
|
|
113
|
+
setOrDeleteAttribute(attributes, RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE, sanitizeProstoreFileId(attributes[RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE]));
|
|
114
|
+
};
|
|
115
|
+
var addLazyImageLoadingAttributes = function addLazyImageLoadingAttributes(tagName, attributes) {
|
|
116
|
+
if (tagName === 'img' && attributes.src) {
|
|
117
|
+
attributes.loading = 'lazy';
|
|
118
|
+
attributes.decoding = 'async';
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var transformImageTag = function transformImageTag(tagName, attribs) {
|
|
122
|
+
var sanitizedAttributes = _objectSpread({}, attribs);
|
|
123
|
+
sanitizeImageTagAttributes(tagName, sanitizedAttributes);
|
|
124
|
+
sanitizeClassAttribute(sanitizedAttributes);
|
|
125
|
+
sanitizeImageUrlAttributes(sanitizedAttributes);
|
|
126
|
+
sanitizeProstoreFileIdAttribute(sanitizedAttributes);
|
|
127
|
+
addLazyImageLoadingAttributes(tagName, sanitizedAttributes);
|
|
128
|
+
return {
|
|
129
|
+
tagName: tagName,
|
|
130
|
+
attribs: sanitizedAttributes
|
|
131
|
+
};
|
|
132
|
+
};
|
|
4
133
|
export var sanitizeTextEditorHtml = function sanitizeTextEditorHtml(html) {
|
|
5
134
|
if (!html) {
|
|
6
135
|
return '';
|
|
7
136
|
}
|
|
8
137
|
return sanitizeHtml(html, {
|
|
9
|
-
allowedTags: ['p', 'br', 'strong', 'b', 'em', 'i', 'u', 's', 'span', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'a', 'figure', 'figcaption', 'table', 'colgroup', 'col', 'thead', 'tbody', 'tr', 'td', 'th', 'blockquote', 'pre', 'code', 'hr', 'img', 'sub', 'sup'],
|
|
138
|
+
allowedTags: ['p', 'br', 'strong', 'b', 'em', 'i', 'u', 's', 'span', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'a', 'figure', 'figcaption', 'table', 'colgroup', 'col', 'thead', 'tbody', 'tr', 'td', 'th', 'blockquote', 'pre', 'code', 'hr', 'img', 'picture', 'source', 'sub', 'sup'],
|
|
10
139
|
allowedAttributes: {
|
|
11
|
-
'*': ['style', 'class'
|
|
140
|
+
'*': ['style', 'class'],
|
|
12
141
|
a: ['href', 'title', 'target', 'rel'],
|
|
13
|
-
|
|
142
|
+
figure: ['class', RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE],
|
|
143
|
+
picture: ['class', RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE],
|
|
144
|
+
source: ['srcset', 'sizes', 'type', 'media'],
|
|
145
|
+
img: ['src', 'srcset', 'sizes', 'alt', 'title', 'width', 'height', 'loading', 'decoding', 'class', RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE],
|
|
14
146
|
table: ['border', 'cellpadding', 'cellspacing'],
|
|
15
147
|
col: ['span'],
|
|
16
148
|
td: ['colspan', 'rowspan'],
|
|
@@ -53,12 +185,24 @@ export var sanitizeTextEditorHtml = function sanitizeTextEditorHtml(html) {
|
|
|
53
185
|
'border-style': [/^(?:none|solid|dashed|dotted|double)$/],
|
|
54
186
|
'list-style-type': [/.*/],
|
|
55
187
|
'vertical-align': [/.*/],
|
|
56
|
-
'white-space': [/.*/]
|
|
188
|
+
'white-space': [/.*/],
|
|
189
|
+
'aspect-ratio': [/^\d+(?:\.\d+)?(?:\s*\/\s*\d+(?:\.\d+)?)?$/]
|
|
57
190
|
}
|
|
58
191
|
},
|
|
59
192
|
allowedSchemes: ['http', 'https', 'mailto', 'tel'],
|
|
60
193
|
allowedSchemesByTag: {
|
|
61
|
-
img: ['
|
|
194
|
+
img: ['http', 'https'],
|
|
195
|
+
source: ['http', 'https']
|
|
196
|
+
},
|
|
197
|
+
transformTags: {
|
|
198
|
+
figure: transformImageTag,
|
|
199
|
+
figcaption: transformImageTag,
|
|
200
|
+
picture: transformImageTag,
|
|
201
|
+
source: transformImageTag,
|
|
202
|
+
img: transformImageTag
|
|
203
|
+
},
|
|
204
|
+
exclusiveFilter: function exclusiveFilter(frame) {
|
|
205
|
+
return frame.tag === 'img' && !frame.attribs.src || frame.tag === 'source' && !frame.attribs.srcset;
|
|
62
206
|
},
|
|
63
207
|
allowedIframeHostnames: []
|
|
64
208
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorOutput.utils.js","names":["sanitizeHtml","sanitizeTextEditorHtml","html","allowedTags","allowedAttributes","a","img","table","col","td","th","allowedStyles","color","width","height","margin","padding","border","allowedSchemes","allowedSchemesByTag","allowedIframeHostnames"],"sources":["../../src/TextEditorOutput/TextEditorOutput.utils.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html'\n\n/** Sanitize HTML content while preserving custom styling */\nexport const sanitizeTextEditorHtml = (html: string) => {\n if (!html) {\n return ''\n }\n\n return sanitizeHtml(html, {\n allowedTags: [\n 'p',\n 'br',\n 'strong',\n 'b',\n 'em',\n 'i',\n 'u',\n 's',\n 'span',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'ul',\n 'ol',\n 'li',\n 'a',\n 'figure',\n 'figcaption',\n 'table',\n 'colgroup',\n 'col',\n 'thead',\n 'tbody',\n 'tr',\n 'td',\n 'th',\n 'blockquote',\n 'pre',\n 'code',\n 'hr',\n 'img',\n 'sub',\n 'sup',\n ],\n allowedAttributes: {\n '*': ['style', 'class', 'data-*'],\n a: ['href', 'title', 'target', 'rel'],\n img: ['src', 'alt', 'title', 'width', 'height'],\n table: ['border', 'cellpadding', 'cellspacing'],\n col: ['span'],\n td: ['colspan', 'rowspan'],\n th: ['colspan', 'rowspan', 'scope'],\n },\n allowedStyles: {\n '*': {\n color: [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'background-color': [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'font-size': [/^\\d+(?:px|pt|em|rem|%)$/],\n 'font-weight': [/^(?:normal|bold|bolder|lighter|\\d{1,3})$/],\n 'font-style': [/^(?:normal|italic|oblique)$/],\n 'font-family': [/.*/],\n 'text-decoration': [/^(?:none|underline|line-through|overline)$/],\n 'text-align': [/^(?:left|right|center|justify)$/],\n 'line-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)?$/],\n width: [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'min-width': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'max-width': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n height: [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'min-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'max-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n margin: [/^\\d+(?:px|pt|em|rem|%)?(?:\\s+\\d+(?:px|pt|em|rem|%)?)*$/],\n 'margin-top': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-bottom': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-left': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-right': [/^\\d+(?:px|pt|em|rem|%)?$/],\n padding: [/^\\d+(?:px|pt|em|rem|%)?(?:\\s+\\d+(?:px|pt|em|rem|%)?)*$/],\n 'padding-top': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-bottom': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-left': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-right': [/^\\d+(?:px|pt|em|rem|%)?$/],\n border: [/.*/],\n 'border-top': [/.*/],\n 'border-bottom': [/.*/],\n 'border-left': [/.*/],\n 'border-right': [/.*/],\n 'border-color': [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'border-width': [/^\\d+(?:px|pt|em|rem)?$/],\n 'border-style': [/^(?:none|solid|dashed|dotted|double)$/],\n 'list-style-type': [/.*/],\n 'vertical-align': [/.*/],\n 'white-space': [/.*/],\n },\n },\n allowedSchemes: ['http', 'https', 'mailto', 'tel'],\n allowedSchemesByTag: {\n img: ['data', 'http', 'https'],\n },\n allowedIframeHostnames: [],\n })\n}\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,eAAe;;AAExC;AACA,OAAO,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAIC,IAAY,EAAK;EACtD,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,EAAE;EACX;EAEA,OAAOF,YAAY,CAACE,IAAI,EAAE;IACxBC,WAAW,EAAE,CACX,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,IA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AAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO;IAC/B,CAAC;IACDc,sBAAsB,EAAE;EAC1B,CAAC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"TextEditorOutput.utils.js","names":["sanitizeHtml","RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE","canonicalizeTextEditorImageUrl","isAllowedTextEditorImageUrl","CKEDITOR_IMAGE_CLASSES","Set","IMAGE_TAGS","sanitizeSrcset","srcset","candidates","split","map","candidate","trim","filter","Boolean","length","undefined","sanitizedCandidates","_candidate$split","_candidate$split2","_toArray","url","descriptors","slice","canonicalUrl","some","descriptor","test","concat","_toConsumableArray","join","includes","sanitizeImageClass","className","allowedClasses","name","has","sanitizeImageSizes","sizes","sanitizeProstoreFileId","id","SAFE_IMAGE_STYLE_PROPERTIES","filterImageStyle","style","safeDeclarations","declaration","_property$trim$toLowe","_declaration$split","_declaration$split2","_slicedToArray","property","toLowerCase","setOrDeleteAttribute","attributes","value","sanitizeImageTagAttributes","tagName","onclick","onload","sanitizeClassAttribute","sanitizeUrlAttribute","sanitize","sanitizeImageUrlAttributes","sanitizeProstoreFileIdAttribute","addLazyImageLoadingAttributes","src","loading","decoding","transformImageTag","attribs","sanitizedAttributes","_objectSpread","sanitizeTextEditorHtml","html","allowedTags","allowedAttributes","a","figure","picture","source","img","table","col","td","th","allowedStyles","color","width","height","margin","padding","border","allowedSchemes","allowedSchemesByTag","transformTags","figcaption","exclusiveFilter","frame","tag","allowedIframeHostnames"],"sources":["../../src/TextEditorOutput/TextEditorOutput.utils.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html'\n\nimport { RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE } from '../TextEditor/utils/imageAttributes'\nimport { canonicalizeTextEditorImageUrl } from '../TextEditor/utils/imageUrls'\n\nexport { isAllowedTextEditorImageUrl } from '../TextEditor/utils/imageUrls'\n\ntype Attributes = Record<string, string>\n\nconst CKEDITOR_IMAGE_CLASSES = new Set([\n 'image',\n 'image-inline',\n 'image_resized',\n 'image-style-align-left',\n 'image-style-align-right',\n 'image-style-block-align-left',\n 'image-style-block-align-right',\n 'image-style-side',\n])\n\nconst IMAGE_TAGS = new Set(['figure', 'figcaption', 'picture', 'source', 'img'])\n\nconst sanitizeSrcset = (srcset: string) => {\n const candidates = srcset\n .split(',')\n .map((candidate) => candidate.trim())\n .filter(Boolean)\n\n if (candidates.length === 0) {\n return undefined\n }\n\n const sanitizedCandidates = candidates.map((candidate) => {\n const [url, ...descriptors] = candidate.split(/\\s+/)\n const canonicalUrl = canonicalizeTextEditorImageUrl(url)\n\n if (\n !canonicalUrl ||\n descriptors.some(\n (descriptor) => !/^(?:\\d+w|\\d+(?:\\.\\d+)?x)$/.test(descriptor)\n )\n ) {\n return undefined\n }\n\n return [canonicalUrl, ...descriptors].join(' ')\n })\n\n if (sanitizedCandidates.includes(undefined)) {\n return undefined\n }\n\n return sanitizedCandidates.join(', ')\n}\n\nconst sanitizeImageClass = (className?: string) => {\n const allowedClasses = className\n ?.split(/\\s+/)\n .filter((name) => CKEDITOR_IMAGE_CLASSES.has(name))\n\n return allowedClasses?.length ? allowedClasses.join(' ') : undefined\n}\n\nconst sanitizeImageSizes = (sizes?: string) => {\n if (!sizes || /url\\(|javascript:|data:/i.test(sizes)) {\n return undefined\n }\n\n return /^[\\w\\s().,:+\\-/%]+$/.test(sizes) ? sizes : undefined\n}\n\nconst sanitizeProstoreFileId = (id?: string) =>\n id && /^[\\w-]+$/.test(id) ? id : undefined\n\n// ImageResize writes inline `width: X%` (and occasionally `height`) on the\n// containing <figure>/<img>. Keep only those declarations so resized images\n// render at the user's chosen size, `allowedStyles` further validates the values.\nconst SAFE_IMAGE_STYLE_PROPERTIES = new Set(['width', 'height', 'aspect-ratio'])\n\nconst filterImageStyle = (style?: string) => {\n if (!style) {\n return undefined\n }\n\n const safeDeclarations = style\n .split(';')\n .map((declaration) => declaration.trim())\n .filter(Boolean)\n .filter((declaration) => {\n const [property] = declaration.split(':', 1)\n return SAFE_IMAGE_STYLE_PROPERTIES.has(\n property?.trim().toLowerCase() ?? ''\n )\n })\n\n return safeDeclarations.length ? `${safeDeclarations.join('; ')};` : undefined\n}\n\nconst setOrDeleteAttribute = (\n attributes: Attributes,\n name: string,\n value?: string\n) => {\n if (value) {\n attributes[name] = value\n } else {\n delete attributes[name]\n }\n}\n\nconst sanitizeImageTagAttributes = (\n tagName: string,\n attributes: Attributes\n) => {\n if (!IMAGE_TAGS.has(tagName)) {\n return\n }\n\n setOrDeleteAttribute(attributes, 'style', filterImageStyle(attributes.style))\n delete attributes.onclick\n delete attributes.onload\n}\n\nconst sanitizeClassAttribute = (attributes: Attributes) => {\n setOrDeleteAttribute(\n attributes,\n 'class',\n sanitizeImageClass(attributes.class)\n )\n}\n\nconst sanitizeUrlAttribute = (\n attributes: Attributes,\n name: string,\n sanitize: (value: string) => string | undefined\n) => {\n if (attributes[name]) {\n setOrDeleteAttribute(attributes, name, sanitize(attributes[name]))\n }\n}\n\nconst sanitizeImageUrlAttributes = (attributes: Attributes) => {\n sanitizeUrlAttribute(attributes, 'src', canonicalizeTextEditorImageUrl)\n sanitizeUrlAttribute(attributes, 'srcset', sanitizeSrcset)\n sanitizeUrlAttribute(attributes, 'sizes', sanitizeImageSizes)\n}\n\nconst sanitizeProstoreFileIdAttribute = (attributes: Attributes) => {\n setOrDeleteAttribute(\n attributes,\n RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE,\n sanitizeProstoreFileId(attributes[RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE])\n )\n}\n\nconst addLazyImageLoadingAttributes = (\n tagName: string,\n attributes: Attributes\n) => {\n if (tagName === 'img' && attributes.src) {\n attributes.loading = 'lazy'\n attributes.decoding = 'async'\n }\n}\n\nconst transformImageTag = (tagName: string, attribs: Attributes) => {\n const sanitizedAttributes: Attributes = { ...attribs }\n\n sanitizeImageTagAttributes(tagName, sanitizedAttributes)\n sanitizeClassAttribute(sanitizedAttributes)\n sanitizeImageUrlAttributes(sanitizedAttributes)\n sanitizeProstoreFileIdAttribute(sanitizedAttributes)\n addLazyImageLoadingAttributes(tagName, sanitizedAttributes)\n\n return {\n tagName,\n attribs: sanitizedAttributes,\n }\n}\n\nexport const sanitizeTextEditorHtml = (html: string) => {\n if (!html) {\n return ''\n }\n\n return sanitizeHtml(html, {\n allowedTags: [\n 'p',\n 'br',\n 'strong',\n 'b',\n 'em',\n 'i',\n 'u',\n 's',\n 'span',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'ul',\n 'ol',\n 'li',\n 'a',\n 'figure',\n 'figcaption',\n 'table',\n 'colgroup',\n 'col',\n 'thead',\n 'tbody',\n 'tr',\n 'td',\n 'th',\n 'blockquote',\n 'pre',\n 'code',\n 'hr',\n 'img',\n 'picture',\n 'source',\n 'sub',\n 'sup',\n ],\n allowedAttributes: {\n '*': ['style', 'class'],\n a: ['href', 'title', 'target', 'rel'],\n figure: ['class', RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE],\n picture: ['class', RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE],\n source: ['srcset', 'sizes', 'type', 'media'],\n img: [\n 'src',\n 'srcset',\n 'sizes',\n 'alt',\n 'title',\n 'width',\n 'height',\n 'loading',\n 'decoding',\n 'class',\n RICH_TEXT_EDITOR_FILE_ID_ATTRIBUTE,\n ],\n table: ['border', 'cellpadding', 'cellspacing'],\n col: ['span'],\n td: ['colspan', 'rowspan'],\n th: ['colspan', 'rowspan', 'scope'],\n },\n allowedStyles: {\n '*': {\n color: [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'background-color': [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'font-size': [/^\\d+(?:px|pt|em|rem|%)$/],\n 'font-weight': [/^(?:normal|bold|bolder|lighter|\\d{1,3})$/],\n 'font-style': [/^(?:normal|italic|oblique)$/],\n 'font-family': [/.*/],\n 'text-decoration': [/^(?:none|underline|line-through|overline)$/],\n 'text-align': [/^(?:left|right|center|justify)$/],\n 'line-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)?$/],\n width: [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'min-width': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'max-width': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n height: [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'min-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n 'max-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)$/],\n margin: [/^\\d+(?:px|pt|em|rem|%)?(?:\\s+\\d+(?:px|pt|em|rem|%)?)*$/],\n 'margin-top': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-bottom': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-left': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-right': [/^\\d+(?:px|pt|em|rem|%)?$/],\n padding: [/^\\d+(?:px|pt|em|rem|%)?(?:\\s+\\d+(?:px|pt|em|rem|%)?)*$/],\n 'padding-top': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-bottom': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-left': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-right': [/^\\d+(?:px|pt|em|rem|%)?$/],\n border: [/.*/],\n 'border-top': [/.*/],\n 'border-bottom': [/.*/],\n 'border-left': [/.*/],\n 'border-right': [/.*/],\n 'border-color': [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'border-width': [/^\\d+(?:px|pt|em|rem)?$/],\n 'border-style': [/^(?:none|solid|dashed|dotted|double)$/],\n 'list-style-type': [/.*/],\n 'vertical-align': [/.*/],\n 'white-space': [/.*/],\n 'aspect-ratio': [/^\\d+(?:\\.\\d+)?(?:\\s*\\/\\s*\\d+(?:\\.\\d+)?)?$/],\n },\n },\n allowedSchemes: ['http', 'https', 'mailto', 'tel'],\n allowedSchemesByTag: {\n img: ['http', 'https'],\n source: ['http', 'https'],\n },\n transformTags: {\n figure: transformImageTag,\n figcaption: transformImageTag,\n picture: transformImageTag,\n source: transformImageTag,\n img: transformImageTag,\n },\n exclusiveFilter: (frame) =>\n (frame.tag === 'img' && !frame.attribs.src) ||\n (frame.tag === 'source' && !frame.attribs.srcset),\n allowedIframeHostnames: [],\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,YAAY,MAAM,eAAe;AAExC,SAASC,kCAAkC,QAAQ,qCAAqC;AACxF,SAASC,8BAA8B,QAAQ,+BAA+B;AAE9E,SAASC,2BAA2B,QAAQ,+BAA+B;AAI3E,IAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CACrC,OAAO,EACP,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,+BAA+B,EAC/B,kBAAkB,CACnB,CAAC;AAEF,IAAMC,UAAU,GAAG,IAAID,GAAG,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAEhF,IAAME,cAAc,GAAG,SAAj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