@conduction/nextcloud-vue 2.162.0 → 2.163.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js +9 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js.map +1 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js +304 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js.map +1 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js +161 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js.map +1 -0
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js +2 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js.map +1 -1
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue.js +1 -1
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue2.js +4 -0
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +2 -2
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue.js +1 -1
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue2.js +4 -3
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnIconPicker/iconCatalogues.js +16 -3
- package/dist/esm/components/CnIconPicker/iconCatalogues.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +76 -8
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue2.js +2 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue2.js.map +1 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue3.js.map +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue.js +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js +6 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue2.js +4 -0
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue3.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue.js +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue2.js +10 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue3.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue2.js +22 -0
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue2.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue3.js.map +1 -1
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue2.js +4 -0
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue2.js.map +1 -1
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue3.js.map +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue.js +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js.map +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +30 -2
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js +3 -2
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue2.js +2 -6
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue2.js +2 -6
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue3.js.map +1 -1
- package/dist/esm/integrations/utils/marker.js +35 -6
- package/dist/esm/integrations/utils/marker.js.map +1 -1
- package/dist/esm/l10n/en.json.js +8 -0
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +8 -0
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +478 -334
- package/dist/esm/utils/fillTemplate.js +3 -0
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/htmlToText.js +36 -0
- package/dist/esm/utils/htmlToText.js.map +1 -0
- package/dist/esm/utils/prototypeKeys.js +20 -0
- package/dist/esm/utils/prototypeKeys.js.map +1 -0
- package/dist/esm/utils/toastUiRawHtmlGuard.js +166 -0
- package/dist/esm/utils/toastUiRawHtmlGuard.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +11501 -10640
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +478 -334
- package/l10n/en.json +8 -0
- package/l10n/nl.json +8 -0
- package/package.json +1 -1
- package/src/components/CnChipListManager/CnChipListManager.vue +504 -0
- package/src/components/CnChipListManager/index.js +4 -0
- package/src/components/CnFilesBrowser/openRegisterSource.js +2 -1
- package/src/components/CnFilterRowsEditor/CnFilterRowsEditor.vue +4 -0
- package/src/components/CnFormDialog/CnFormDialog.vue +2 -2
- package/src/components/CnIconPicker/CnIconPicker.vue +4 -3
- package/src/components/CnIconPicker/iconCatalogues.js +16 -3
- package/src/components/CnIndexPage/CnIndexPage.vue +78 -10
- package/src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue +2 -1
- package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +6 -1
- package/src/components/CnObjectListWidget/CnObjectListWidget.vue +1 -1
- package/src/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue +4 -0
- package/src/components/CnPageTreeNode/CnPageTreeRow.vue +10 -1
- package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +22 -0
- package/src/components/CnStagesWidgetForm/CnStagesWidgetForm.vue +4 -0
- package/src/components/CnWalkthrough/CnWalkthrough.vue +1 -1
- package/src/components/index.js +1 -0
- package/src/composables/indexSources.js +30 -2
- package/src/css/look-board-detail.css +6 -4
- package/src/css/look-board.css +46 -1
- package/src/index.js +1 -0
- package/src/integrations/builtin/analytics/CnAnalyticsCard.vue +2 -1
- package/src/integrations/builtin/analytics/CnAnalyticsTab.vue +3 -2
- package/src/integrations/builtin/photos/CnPhotosCard.vue +2 -1
- package/src/integrations/builtin/photos/CnPhotosTab.vue +2 -1
- package/src/integrations/builtin/xwiki/CnXwikiCard.vue +2 -6
- package/src/integrations/builtin/xwiki/CnXwikiTab.vue +2 -6
- package/src/integrations/utils/marker.js +35 -6
- package/src/utils/fillTemplate.js +3 -0
- package/src/utils/htmlToText.js +33 -0
- package/src/utils/prototypeKeys.js +17 -0
- package/src/utils/toastUiRawHtmlGuard.js +162 -0
|
@@ -349,6 +349,9 @@ function splitFields(template) {
|
|
|
349
349
|
*/
|
|
350
350
|
function joinTemplateParts(template, valueOf) {
|
|
351
351
|
const parts = splitFields(template);
|
|
352
|
+
if (parts.length === 1) {
|
|
353
|
+
return parts[0]
|
|
354
|
+
}
|
|
352
355
|
const lead = parts[0];
|
|
353
356
|
const tail = parts[parts.length - 1];
|
|
354
357
|
let body = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fillTemplate.js","sources":["../../../src/utils/fillTemplate.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 Conduction B.V.\n// SPDX-License-Identifier: EUPL-1.2\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { boardDateLocale, formatAgo, formatBoardDate, formatBoardWeekday, formatRelativeDate, formatSoon, formatTimeOfDay, isoWeek } from './boardDate.js'\nimport { BUILT_IN_FORMATTERS } from './builtInFormatters.js'\nimport { parseDateValue } from './dateVariant.js'\nimport { formatMoney, metricLocale } from './formatMetric.js'\nimport { groupDisplayName, loadGroupDisplayName } from './groupAutocomplete.js'\nimport { readPath } from './readPath.js'\nimport { userDisplayName } from './userDisplayName.js'\n\nconst TOKEN = /\\{([^{}\\s|]+)(?:\\|([A-Za-z]+)(?::([^{}\\s]+))?)?\\}/g\n\n/**\n * A moment in the board's short form with the time: \"4 okt, 10:52\", or\n * \"14 feb 2024, 09:00\" outside the current year.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} [now] The reference moment.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function formatBoardDateTime(value, now = new Date()) {\n\tconst day = formatBoardDate(value, now)\n\tconst date = parseDateValue(value)\n\tif (day === '' || date === null) {\n\t\treturn ''\n\t}\n\tlet time\n\ttry {\n\t\ttime = new Intl.DateTimeFormat(boardDateLocale(), { hour: '2-digit', minute: '2-digit' }).format(date)\n\t} catch {\n\t\ttime = new Intl.DateTimeFormat(undefined, { hour: '2-digit', minute: '2-digit' }).format(date)\n\t}\n\treturn `${day}, ${time}`\n}\n\n/**\n * A date with the month written out: \"7 oktober\", or \"6 oktober 2026\"\n * outside the current year or when `withYear` asks for it.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} now The reference moment.\n * @param {boolean} [withYear] Always write the year.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-header-meta-tokens/specs/detail-page-board-look/spec.md#requirement-the-header-meta-line-formats-users-long-dates-and-enum-labels\n */\nexport function formatLongDate(value, now = new Date(), withYear = false) {\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\treturn ''\n\t}\n\tconst options = { day: 'numeric', month: 'long' }\n\tif (withYear || date.getFullYear() !== now.getFullYear()) {\n\t\toptions.year = 'numeric'\n\t}\n\ttry {\n\t\treturn new Intl.DateTimeFormat(boardDateLocale(), options).format(date)\n\t} catch {\n\t\treturn new Intl.DateTimeFormat(undefined, options).format(date)\n\t}\n}\n\n/**\n * A date written out in full, the way a letter or an invitation does:\n * \"Donderdag 12 november 2026\". The weekday is capitalised, because the\n * line starts with it.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/template-full-date/specs/detail-page-board-look/spec.md#requirement-a-template-can-write-a-date-in-full\n */\nexport function formatFullDate(value) {\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\treturn ''\n\t}\n\tconst options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n\tlet text\n\ttry {\n\t\ttext = new Intl.DateTimeFormat(boardDateLocale(), options).format(date)\n\t} catch {\n\t\ttext = new Intl.DateTimeFormat(undefined, options).format(date)\n\t}\n\treturn text.charAt(0).toLocaleUpperCase() + text.slice(1)\n}\n\n/**\n * How many entries a list holds; with a key, the entries of that list in each\n * of its entries summed (`{sections|count:items}`: the questions of every\n * section of a checklist).\n *\n * @param {Array} list The list.\n * @param {string} key The key of each entry's own list, or '' to count the entries.\n * @return {number} The count.\n */\nfunction countEntries(list, key) {\n\tif (key === '') {\n\t\treturn list.length\n\t}\n\treturn list.reduce((sum, entry) => sum + (entry && Array.isArray(entry[key]) ? entry[key].length : 0), 0)\n}\n\n/**\n * Whether a named formatter is the library's own `date` or `datetime`, which\n * CnAppRoot puts in every page's formatters: the template's board date\n * (\"28 okt\") wins over it, an app's own formatter of that name does not.\n *\n * @param {string} format The format name.\n * @param {(value: unknown, row?: object) => unknown} formatter The formatter found under that name.\n * @return {boolean} True for the built-in date formatters.\n * @spec openspec/changes/template-date-not-shadowed/specs/template-date-not-shadowed/spec.md\n */\nfunction isBuiltInDateFormatter(format, formatter) {\n\treturn (format === 'date' || format === 'datetime') && formatter === BUILT_IN_FORMATTERS[format]\n}\n\n/**\n * Format one token value.\n *\n * @param {unknown} value The raw value.\n * @param {string} format `date`, `datetime`, `weekday`, `longdate`, `fulldate`, `time`, `user`, `group`, `currency`, `relative`, `relativetime`, `ago`, `soon`, `week`, `days`, `lower`, `mailbox` or '' (as is).\n * @param {Date} now The reference moment.\n * @param {string} [arg] The format's argument (`currency:EUR`, or a row path holding the code).\n * @param {object|null} [object] The row, for a currency read from a field.\n * @param {object|null} [config] The app config map, for the reporting currency.\n * @param {object|null} [formatters] The app's named formatters (`cnFormatters`), for any other format name.\n * @return {string} The text, '' when nothing can be shown.\n * @spec openspec/changes/map-list-formatters/specs/map-list-formatters/spec.md#requirement-a-map-list-reads-display-names-through-the-apps-formatters\n */\nfunction formatValue(value, format, now, arg = '', object = null, config = null, formatters = null) {\n\t// `{list|count}`: how many entries a list holds, nothing for an empty one.\n\tif (format === 'count') {\n\t\tconst count = Array.isArray(value) ? countEntries(value, arg) : Number(value)\n\t\treturn Number.isFinite(count) && count > 0 ? String(count) : ''\n\t}\n\tif (value === null || value === undefined || value === '' || typeof value === 'object') {\n\t\treturn ''\n\t}\n\tif (format !== '' && formatters && typeof formatters[format] === 'function' && !isBuiltInDateFormatter(format, formatters[format])) {\n\t\tconst shown = formatters[format](value, object)\n\t\treturn shown === null || shown === undefined ? '' : String(shown)\n\t}\n\tif (format === 'date') {\n\t\treturn formatBoardDate(value, now)\n\t}\n\tif (format === 'datetime') {\n\t\treturn formatBoardDateTime(value, now)\n\t}\n\tif (format === 'weekday') {\n\t\treturn formatBoardWeekday(value, now, { today: arg === 'today' })\n\t}\n\tif (format === 'week') {\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : t('nextcloud-vue', 'Week {week}', { week: isoWeek(date) })\n\t}\n\tif (format === 'longdate') {\n\t\treturn formatLongDate(value, now, arg === 'year')\n\t}\n\tif (format === 'fulldate') {\n\t\treturn formatFullDate(value)\n\t}\n\tif (format === 'user') {\n\t\treturn userDisplayName(value)\n\t}\n\tif (format === 'group') {\n\t\tconst name = groupDisplayName(value)\n\t\tif (name === null) {\n\t\t\tloadGroupDisplayName(value)\n\t\t\treturn ''\n\t\t}\n\t\treturn name\n\t}\n\tif (format === 'time') {\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : formatTimeOfDay(date)\n\t}\n\tif (format === 'currency') {\n\t\t// `{amount|currency:EUR}` names the code, `{amount|currency:price.code}`\n\t\t// reads it from the row, `{amount|currency}` is the app's reporting\n\t\t// currency (EUR without one).\n\t\tconst isCode = /^[A-Za-z]{3}$/.test(arg)\n\t\treturn formatMoney(value, { currency: isCode ? arg : undefined, currencyField: !isCode && arg ? arg : undefined }, object, config)\n\t}\n\tif (format === 'relative') {\n\t\treturn formatRelativeDate(value, { now })\n\t}\n\tif (format === 'relativetime') {\n\t\treturn formatRelativeDate(value, { now, withTime: true })\n\t}\n\tif (format === 'ago') {\n\t\treturn formatAgo(value, now)\n\t}\n\tif (format === 'soon') {\n\t\treturn formatSoon(value, now)\n\t}\n\tif (format === 'mailbox') {\n\t\t// An address up to and with its @ (\"gemeente@\" from gemeente@zuiddrecht.nl).\n\t\tconst text = String(value)\n\t\tconst at = text.indexOf('@')\n\t\treturn at > 0 ? text.slice(0, at + 1) : text\n\t}\n\tif (format === 'lower') {\n\t\treturn String(value).toLocaleLowerCase()\n\t}\n\t// `{name|lowerfirst}`: a name inside a sentence, \"Verenigingen in Zuiddrecht\"\n\t// read as \"verenigingen in Zuiddrecht\".\n\tif (format === 'lowerfirst') {\n\t\tconst text = String(value)\n\t\treturn text.charAt(0).toLocaleLowerCase() + text.slice(1)\n\t}\n\t// `{count|number}`: grouped in the user's locale, \"2.180\" in Dutch.\n\tif (format === 'number') {\n\t\tconst number = Number(value)\n\t\treturn Number.isFinite(number) ? new Intl.NumberFormat(metricLocale()).format(number) : String(value)\n\t}\n\tif (format === 'days') {\n\t\t// Whole days from the date to now (0 for today; negative for a future date).\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : String(Math.floor((now.getTime() - date.getTime()) / 86400000))\n\t}\n\treturn String(value)\n}\n\n/**\n * Fill a row template such as `\"{identifier} · {caseTypeName}\"` or\n * `\"Termijn {deadline|date}\"` from an object.\n *\n * Every `{path}` token is a dot path into the object; `{path|date}` and\n * `{path|datetime}` format it as the boards write dates, `{path|weekday}` adds\n * the short weekday (\"wo 7 okt\"; `{path|weekday:today}` reads \"Vandaag, wo 7 okt\"\n * for today), `{path|longdate}` writes the month out (\"7 oktober\";\n * `{path|longdate:year}` always adds the year), `{path|fulldate}` writes the weekday and the year too (\"Donderdag 12 november 2026\"), `{path|time}` is the time\n * of day (\"08:45\"), `{path|user}` is a user id's display name (looked up\n * once, '' until it arrives), `{path|group}` is a group id's display name\n * (the same, through the group name cache), `{path|currency}`,\n * `{path|currency:EUR}` and `{path|currency:field}` write an amount in a\n * currency (a code, or the row field that holds it; without either, or when\n * the row field is empty, the app's reporting currency), `{path|relative}` and\n * `{path|relativetime}` say \"today\", \"yesterday\" and then the short date\n * (\"vandaag, 09.42\"), `{path|ago}` says how long ago it was (\"10 min\n * geleden\", \"vanochtend\", \"vrijdag\"), `{path|soon}` says when a coming moment\n * is due (\"13.00\" today, \"morgen\", \"woensdag\", then the short date), and `{path|days}` is the\n * whole days since that date (\"has waited {createdAt|days} days\"),\n * `{path|count}` is how many entries a list holds (nothing for an empty one;\n * `{path|count:key}` sums the `key` list of each entry),\n * `{path|lower}` writes the value in lower case (\"Step 2: {statusLabel|lower}\"\n * reads \"Step 2: in progress\" mid-sentence), and any other name is one of\n * the app's formatters, passed as `context.formatters` (`{id|caseAddress}`).\n * A token without a\n * value empties the WHOLE template, because \"Termijn \" is worse than nothing.\n * A template without tokens is returned as written (a constant label).\n *\n * @param {string} template The template, already translated.\n * @param {object|null} object The object to read.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object, formatters?: object}|null} [context] The app config map, for the reporting currency of a money token, and the app's named formatters.\n * @return {string} The filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function fillTemplate(template, object, now = new Date(), context = null) {\n\tif (typeof template !== 'string' || template.trim() === '') {\n\t\treturn ''\n\t}\n\tlet missing = false\n\tconst text = template.replace(TOKEN, (_match, path, format, arg) => {\n\t\tconst value = object && typeof object === 'object' ? readPath(object, path) : undefined\n\t\tconst shown = formatValue(value, format || '', now, arg || '', object, context && context.config ? context.config : null, context && context.formatters ? context.formatters : null)\n\t\tif (shown === '') {\n\t\t\tmissing = true\n\t\t}\n\t\treturn shown\n\t})\n\treturn missing ? '' : text.trim()\n}\n\n/**\n * The first of several templates that fills: `[\"Klaar {closedAt|date}\",\n * \"Termijn {deadline|date}\"]` reads \"Klaar ...\" once the case is closed and\n * \"Termijn ...\" while it is open. A single string is one candidate.\n *\n * @param {string|string[]} templates The candidates, in order.\n * @param {object|null} object The object to read.\n * @param {(key: string) => string} [translate] Applied to each template before filling.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object}|null} [context] Passed on to `fillTemplate`.\n * @return {string} The first filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function firstFilled(templates, object, translate = (key) => key, now = new Date(), context = null) {\n\tconst list = Array.isArray(templates) ? templates : [templates]\n\tfor (const template of list) {\n\t\tif (typeof template !== 'string') {\n\t\t\tcontinue\n\t\t}\n\t\tconst text = fillTemplate(translate(template), object, now, context)\n\t\tif (text !== '') {\n\t\t\treturn text\n\t\t}\n\t}\n\treturn ''\n}\n\n/**\n * Split a template into literal, field, literal, … as\n * `template.split(/\\{([^}]+)\\}/)` does, in one linear pass.\n *\n * @param {string} template The template, with `{field}` placeholders.\n * @return {string[]} The literals at even indexes, the field names at odd ones.\n */\nfunction splitFields(template) {\n\tconst parts = []\n\tlet literalStart = 0\n\tlet open = template.indexOf('{')\n\twhile (open !== -1) {\n\t\tconst close = template.indexOf('}', open + 1)\n\t\tif (close === -1) {\n\t\t\tbreak\n\t\t}\n\t\tif (close === open + 1) {\n\t\t\topen = template.indexOf('{', close + 1)\n\t\t\tcontinue\n\t\t}\n\t\tparts.push(template.slice(literalStart, open), template.slice(open + 1, close))\n\t\tliteralStart = close + 1\n\t\topen = template.indexOf('{', literalStart)\n\t}\n\tparts.push(template.slice(literalStart))\n\treturn parts\n}\n\n/**\n * Fill a template such as `\"{identifier} · {requester}\"` field by field\n * (a table column's `secondary` line, a detail page's meta line).\n *\n * A field without a value takes its separator with it: the text between two\n * fields belongs to the field after it, so an empty requester leaves\n * \"2026-0002\", not \"2026-0002 ·\", and an empty first field does not leave a\n * leading separator either. Text before the first field and after the last\n * one is kept as written. A template whose fields all have values fills\n * exactly as before.\n *\n * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-an-empty-field-takes-its-separator-with-it\n * @param {string} template The template, with `{field}` placeholders.\n * @param {(key: string) => string} valueOf The text of a field ('' when empty).\n * @return {string} The filled template.\n */\nexport function joinTemplateParts(template, valueOf) {\n\tconst parts = splitFields(template)\n\tconst lead = parts[0]\n\tconst tail = parts[parts.length - 1]\n\tlet body = ''\n\tfor (let i = 1; i < parts.length; i += 2) {\n\t\tconst value = valueOf(parts[i].trim())\n\t\tif (value === '') {\n\t\t\tcontinue\n\t\t}\n\t\t// The literal before this field: the separator, unless nothing has\n\t\t// been written yet (then there is nothing to separate from).\n\t\tconst separator = i === 1 ? '' : parts[i - 1]\n\t\tbody += (body === '' ? '' : separator) + value\n\t}\n\treturn lead + body + tail\n}\n"],"names":["t"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AASA;AACA,MAAM,KAAK,GAAG,qDAAoD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE;AAC7D,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,EAAC;AACxC,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,EAAC;AACnC,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AAClC,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,IAAI,KAAI;AACT,CAAC,IAAI;AACL,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAC;AACxG,EAAE,CAAC,MAAM;AACT,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAC;AAChG,EAAE;AACF,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC;AACD;AACA;AACA;AACA;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,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAC;AACrC,CAAC,IAAI,IAAI,GAAG,GAAE;AACd,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC3C,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAC;AACxC,EAAE,IAAI,KAAK,KAAK,EAAE,EAAE;AACpB,GAAG,QAAQ;AACX,GAAG;AACH;AACA;AACA,EAAE,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,EAAC;AAC/C,EAAE,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,GAAG,EAAE,GAAG,SAAS,IAAI,MAAK;AAChD,EAAE;AACF,CAAC,OAAO,IAAI,GAAG,IAAI,GAAG,IAAI;AAC1B;;;;"}
|
|
1
|
+
{"version":3,"file":"fillTemplate.js","sources":["../../../src/utils/fillTemplate.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 Conduction B.V.\n// SPDX-License-Identifier: EUPL-1.2\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { boardDateLocale, formatAgo, formatBoardDate, formatBoardWeekday, formatRelativeDate, formatSoon, formatTimeOfDay, isoWeek } from './boardDate.js'\nimport { BUILT_IN_FORMATTERS } from './builtInFormatters.js'\nimport { parseDateValue } from './dateVariant.js'\nimport { formatMoney, metricLocale } from './formatMetric.js'\nimport { groupDisplayName, loadGroupDisplayName } from './groupAutocomplete.js'\nimport { readPath } from './readPath.js'\nimport { userDisplayName } from './userDisplayName.js'\n\nconst TOKEN = /\\{([^{}\\s|]+)(?:\\|([A-Za-z]+)(?::([^{}\\s]+))?)?\\}/g\n\n/**\n * A moment in the board's short form with the time: \"4 okt, 10:52\", or\n * \"14 feb 2024, 09:00\" outside the current year.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} [now] The reference moment.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function formatBoardDateTime(value, now = new Date()) {\n\tconst day = formatBoardDate(value, now)\n\tconst date = parseDateValue(value)\n\tif (day === '' || date === null) {\n\t\treturn ''\n\t}\n\tlet time\n\ttry {\n\t\ttime = new Intl.DateTimeFormat(boardDateLocale(), { hour: '2-digit', minute: '2-digit' }).format(date)\n\t} catch {\n\t\ttime = new Intl.DateTimeFormat(undefined, { hour: '2-digit', minute: '2-digit' }).format(date)\n\t}\n\treturn `${day}, ${time}`\n}\n\n/**\n * A date with the month written out: \"7 oktober\", or \"6 oktober 2026\"\n * outside the current year or when `withYear` asks for it.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} now The reference moment.\n * @param {boolean} [withYear] Always write the year.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-header-meta-tokens/specs/detail-page-board-look/spec.md#requirement-the-header-meta-line-formats-users-long-dates-and-enum-labels\n */\nexport function formatLongDate(value, now = new Date(), withYear = false) {\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\treturn ''\n\t}\n\tconst options = { day: 'numeric', month: 'long' }\n\tif (withYear || date.getFullYear() !== now.getFullYear()) {\n\t\toptions.year = 'numeric'\n\t}\n\ttry {\n\t\treturn new Intl.DateTimeFormat(boardDateLocale(), options).format(date)\n\t} catch {\n\t\treturn new Intl.DateTimeFormat(undefined, options).format(date)\n\t}\n}\n\n/**\n * A date written out in full, the way a letter or an invitation does:\n * \"Donderdag 12 november 2026\". The weekday is capitalised, because the\n * line starts with it.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/template-full-date/specs/detail-page-board-look/spec.md#requirement-a-template-can-write-a-date-in-full\n */\nexport function formatFullDate(value) {\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\treturn ''\n\t}\n\tconst options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n\tlet text\n\ttry {\n\t\ttext = new Intl.DateTimeFormat(boardDateLocale(), options).format(date)\n\t} catch {\n\t\ttext = new Intl.DateTimeFormat(undefined, options).format(date)\n\t}\n\treturn text.charAt(0).toLocaleUpperCase() + text.slice(1)\n}\n\n/**\n * How many entries a list holds; with a key, the entries of that list in each\n * of its entries summed (`{sections|count:items}`: the questions of every\n * section of a checklist).\n *\n * @param {Array} list The list.\n * @param {string} key The key of each entry's own list, or '' to count the entries.\n * @return {number} The count.\n */\nfunction countEntries(list, key) {\n\tif (key === '') {\n\t\treturn list.length\n\t}\n\treturn list.reduce((sum, entry) => sum + (entry && Array.isArray(entry[key]) ? entry[key].length : 0), 0)\n}\n\n/**\n * Whether a named formatter is the library's own `date` or `datetime`, which\n * CnAppRoot puts in every page's formatters: the template's board date\n * (\"28 okt\") wins over it, an app's own formatter of that name does not.\n *\n * @param {string} format The format name.\n * @param {(value: unknown, row?: object) => unknown} formatter The formatter found under that name.\n * @return {boolean} True for the built-in date formatters.\n * @spec openspec/changes/template-date-not-shadowed/specs/template-date-not-shadowed/spec.md\n */\nfunction isBuiltInDateFormatter(format, formatter) {\n\treturn (format === 'date' || format === 'datetime') && formatter === BUILT_IN_FORMATTERS[format]\n}\n\n/**\n * Format one token value.\n *\n * @param {unknown} value The raw value.\n * @param {string} format `date`, `datetime`, `weekday`, `longdate`, `fulldate`, `time`, `user`, `group`, `currency`, `relative`, `relativetime`, `ago`, `soon`, `week`, `days`, `lower`, `mailbox` or '' (as is).\n * @param {Date} now The reference moment.\n * @param {string} [arg] The format's argument (`currency:EUR`, or a row path holding the code).\n * @param {object|null} [object] The row, for a currency read from a field.\n * @param {object|null} [config] The app config map, for the reporting currency.\n * @param {object|null} [formatters] The app's named formatters (`cnFormatters`), for any other format name.\n * @return {string} The text, '' when nothing can be shown.\n * @spec openspec/changes/map-list-formatters/specs/map-list-formatters/spec.md#requirement-a-map-list-reads-display-names-through-the-apps-formatters\n */\nfunction formatValue(value, format, now, arg = '', object = null, config = null, formatters = null) {\n\t// `{list|count}`: how many entries a list holds, nothing for an empty one.\n\tif (format === 'count') {\n\t\tconst count = Array.isArray(value) ? countEntries(value, arg) : Number(value)\n\t\treturn Number.isFinite(count) && count > 0 ? String(count) : ''\n\t}\n\tif (value === null || value === undefined || value === '' || typeof value === 'object') {\n\t\treturn ''\n\t}\n\tif (format !== '' && formatters && typeof formatters[format] === 'function' && !isBuiltInDateFormatter(format, formatters[format])) {\n\t\tconst shown = formatters[format](value, object)\n\t\treturn shown === null || shown === undefined ? '' : String(shown)\n\t}\n\tif (format === 'date') {\n\t\treturn formatBoardDate(value, now)\n\t}\n\tif (format === 'datetime') {\n\t\treturn formatBoardDateTime(value, now)\n\t}\n\tif (format === 'weekday') {\n\t\treturn formatBoardWeekday(value, now, { today: arg === 'today' })\n\t}\n\tif (format === 'week') {\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : t('nextcloud-vue', 'Week {week}', { week: isoWeek(date) })\n\t}\n\tif (format === 'longdate') {\n\t\treturn formatLongDate(value, now, arg === 'year')\n\t}\n\tif (format === 'fulldate') {\n\t\treturn formatFullDate(value)\n\t}\n\tif (format === 'user') {\n\t\treturn userDisplayName(value)\n\t}\n\tif (format === 'group') {\n\t\tconst name = groupDisplayName(value)\n\t\tif (name === null) {\n\t\t\tloadGroupDisplayName(value)\n\t\t\treturn ''\n\t\t}\n\t\treturn name\n\t}\n\tif (format === 'time') {\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : formatTimeOfDay(date)\n\t}\n\tif (format === 'currency') {\n\t\t// `{amount|currency:EUR}` names the code, `{amount|currency:price.code}`\n\t\t// reads it from the row, `{amount|currency}` is the app's reporting\n\t\t// currency (EUR without one).\n\t\tconst isCode = /^[A-Za-z]{3}$/.test(arg)\n\t\treturn formatMoney(value, { currency: isCode ? arg : undefined, currencyField: !isCode && arg ? arg : undefined }, object, config)\n\t}\n\tif (format === 'relative') {\n\t\treturn formatRelativeDate(value, { now })\n\t}\n\tif (format === 'relativetime') {\n\t\treturn formatRelativeDate(value, { now, withTime: true })\n\t}\n\tif (format === 'ago') {\n\t\treturn formatAgo(value, now)\n\t}\n\tif (format === 'soon') {\n\t\treturn formatSoon(value, now)\n\t}\n\tif (format === 'mailbox') {\n\t\t// An address up to and with its @ (\"gemeente@\" from gemeente@zuiddrecht.nl).\n\t\tconst text = String(value)\n\t\tconst at = text.indexOf('@')\n\t\treturn at > 0 ? text.slice(0, at + 1) : text\n\t}\n\tif (format === 'lower') {\n\t\treturn String(value).toLocaleLowerCase()\n\t}\n\t// `{name|lowerfirst}`: a name inside a sentence, \"Verenigingen in Zuiddrecht\"\n\t// read as \"verenigingen in Zuiddrecht\".\n\tif (format === 'lowerfirst') {\n\t\tconst text = String(value)\n\t\treturn text.charAt(0).toLocaleLowerCase() + text.slice(1)\n\t}\n\t// `{count|number}`: grouped in the user's locale, \"2.180\" in Dutch.\n\tif (format === 'number') {\n\t\tconst number = Number(value)\n\t\treturn Number.isFinite(number) ? new Intl.NumberFormat(metricLocale()).format(number) : String(value)\n\t}\n\tif (format === 'days') {\n\t\t// Whole days from the date to now (0 for today; negative for a future date).\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : String(Math.floor((now.getTime() - date.getTime()) / 86400000))\n\t}\n\treturn String(value)\n}\n\n/**\n * Fill a row template such as `\"{identifier} · {caseTypeName}\"` or\n * `\"Termijn {deadline|date}\"` from an object.\n *\n * Every `{path}` token is a dot path into the object; `{path|date}` and\n * `{path|datetime}` format it as the boards write dates, `{path|weekday}` adds\n * the short weekday (\"wo 7 okt\"; `{path|weekday:today}` reads \"Vandaag, wo 7 okt\"\n * for today), `{path|longdate}` writes the month out (\"7 oktober\";\n * `{path|longdate:year}` always adds the year), `{path|fulldate}` writes the weekday and the year too (\"Donderdag 12 november 2026\"), `{path|time}` is the time\n * of day (\"08:45\"), `{path|user}` is a user id's display name (looked up\n * once, '' until it arrives), `{path|group}` is a group id's display name\n * (the same, through the group name cache), `{path|currency}`,\n * `{path|currency:EUR}` and `{path|currency:field}` write an amount in a\n * currency (a code, or the row field that holds it; without either, or when\n * the row field is empty, the app's reporting currency), `{path|relative}` and\n * `{path|relativetime}` say \"today\", \"yesterday\" and then the short date\n * (\"vandaag, 09.42\"), `{path|ago}` says how long ago it was (\"10 min\n * geleden\", \"vanochtend\", \"vrijdag\"), `{path|soon}` says when a coming moment\n * is due (\"13.00\" today, \"morgen\", \"woensdag\", then the short date), and `{path|days}` is the\n * whole days since that date (\"has waited {createdAt|days} days\"),\n * `{path|count}` is how many entries a list holds (nothing for an empty one;\n * `{path|count:key}` sums the `key` list of each entry),\n * `{path|lower}` writes the value in lower case (\"Step 2: {statusLabel|lower}\"\n * reads \"Step 2: in progress\" mid-sentence), and any other name is one of\n * the app's formatters, passed as `context.formatters` (`{id|caseAddress}`).\n * A token without a\n * value empties the WHOLE template, because \"Termijn \" is worse than nothing.\n * A template without tokens is returned as written (a constant label).\n *\n * @param {string} template The template, already translated.\n * @param {object|null} object The object to read.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object, formatters?: object}|null} [context] The app config map, for the reporting currency of a money token, and the app's named formatters.\n * @return {string} The filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function fillTemplate(template, object, now = new Date(), context = null) {\n\tif (typeof template !== 'string' || template.trim() === '') {\n\t\treturn ''\n\t}\n\tlet missing = false\n\tconst text = template.replace(TOKEN, (_match, path, format, arg) => {\n\t\tconst value = object && typeof object === 'object' ? readPath(object, path) : undefined\n\t\tconst shown = formatValue(value, format || '', now, arg || '', object, context && context.config ? context.config : null, context && context.formatters ? context.formatters : null)\n\t\tif (shown === '') {\n\t\t\tmissing = true\n\t\t}\n\t\treturn shown\n\t})\n\treturn missing ? '' : text.trim()\n}\n\n/**\n * The first of several templates that fills: `[\"Klaar {closedAt|date}\",\n * \"Termijn {deadline|date}\"]` reads \"Klaar ...\" once the case is closed and\n * \"Termijn ...\" while it is open. A single string is one candidate.\n *\n * @param {string|string[]} templates The candidates, in order.\n * @param {object|null} object The object to read.\n * @param {(key: string) => string} [translate] Applied to each template before filling.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object}|null} [context] Passed on to `fillTemplate`.\n * @return {string} The first filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function firstFilled(templates, object, translate = (key) => key, now = new Date(), context = null) {\n\tconst list = Array.isArray(templates) ? templates : [templates]\n\tfor (const template of list) {\n\t\tif (typeof template !== 'string') {\n\t\t\tcontinue\n\t\t}\n\t\tconst text = fillTemplate(translate(template), object, now, context)\n\t\tif (text !== '') {\n\t\t\treturn text\n\t\t}\n\t}\n\treturn ''\n}\n\n/**\n * Split a template into literal, field, literal, … as\n * `template.split(/\\{([^}]+)\\}/)` does, in one linear pass.\n *\n * @param {string} template The template, with `{field}` placeholders.\n * @return {string[]} The literals at even indexes, the field names at odd ones.\n */\nfunction splitFields(template) {\n\tconst parts = []\n\tlet literalStart = 0\n\tlet open = template.indexOf('{')\n\twhile (open !== -1) {\n\t\tconst close = template.indexOf('}', open + 1)\n\t\tif (close === -1) {\n\t\t\tbreak\n\t\t}\n\t\tif (close === open + 1) {\n\t\t\topen = template.indexOf('{', close + 1)\n\t\t\tcontinue\n\t\t}\n\t\tparts.push(template.slice(literalStart, open), template.slice(open + 1, close))\n\t\tliteralStart = close + 1\n\t\topen = template.indexOf('{', literalStart)\n\t}\n\tparts.push(template.slice(literalStart))\n\treturn parts\n}\n\n/**\n * Fill a template such as `\"{identifier} · {requester}\"` field by field\n * (a table column's `secondary` line, a detail page's meta line).\n *\n * A field without a value takes its separator with it: the text between two\n * fields belongs to the field after it, so an empty requester leaves\n * \"2026-0002\", not \"2026-0002 ·\", and an empty first field does not leave a\n * leading separator either. Text before the first field and after the last\n * one is kept as written. A template whose fields all have values fills\n * exactly as before.\n *\n * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-an-empty-field-takes-its-separator-with-it\n * @param {string} template The template, with `{field}` placeholders.\n * @param {(key: string) => string} valueOf The text of a field ('' when empty).\n * @return {string} The filled template.\n */\nexport function joinTemplateParts(template, valueOf) {\n\tconst parts = splitFields(template)\n\tif (parts.length === 1) {\n\t\treturn parts[0]\n\t}\n\tconst lead = parts[0]\n\tconst tail = parts[parts.length - 1]\n\tlet body = ''\n\tfor (let i = 1; i < parts.length; i += 2) {\n\t\tconst value = valueOf(parts[i].trim())\n\t\tif (value === '') {\n\t\t\tcontinue\n\t\t}\n\t\t// The literal before this field: the separator, unless nothing has\n\t\t// been written yet (then there is nothing to separate from).\n\t\tconst separator = i === 1 ? '' : parts[i - 1]\n\t\tbody += (body === '' ? '' : separator) + value\n\t}\n\treturn lead + body + tail\n}\n"],"names":["t"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AASA;AACA,MAAM,KAAK,GAAG,qDAAoD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE;AAC7D,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,EAAC;AACxC,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,EAAC;AACnC,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AAClC,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,IAAI,KAAI;AACT,CAAC,IAAI;AACL,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,EAAE,EAAE,IAAI,EA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2
|
|
4
|
+
*
|
|
5
|
+
* Rendered HTML to inert one-line text, read by the browser's HTML parser
|
|
6
|
+
* rather than by tag patterns, so a split or unclosed tag cannot slip through
|
|
7
|
+
* and a long hostile input stays linear.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const DROPPED = 'script, style, noscript, template';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Reduce HTML to its visible text: script, style, noscript and template
|
|
14
|
+
* content is dropped, comments are skipped, entities are decoded, and every
|
|
15
|
+
* element boundary reads as one space.
|
|
16
|
+
*
|
|
17
|
+
* @param {unknown} html Rendered HTML or plain text.
|
|
18
|
+
* @return {string} The text on one line, trimmed.
|
|
19
|
+
*/
|
|
20
|
+
function htmlToText(html) {
|
|
21
|
+
const source = html === null || html === undefined ? '' : String(html);
|
|
22
|
+
if (source === '') {
|
|
23
|
+
return ''
|
|
24
|
+
}
|
|
25
|
+
const doc = new DOMParser().parseFromString(source, 'text/html');
|
|
26
|
+
doc.querySelectorAll(DROPPED).forEach((node) => node.remove());
|
|
27
|
+
const parts = [];
|
|
28
|
+
const walker = doc.createTreeWalker(doc.documentElement, NodeFilter.SHOW_TEXT);
|
|
29
|
+
while (walker.nextNode()) {
|
|
30
|
+
parts.push(walker.currentNode.nodeValue);
|
|
31
|
+
}
|
|
32
|
+
return parts.join(' ').replace(/\s+/g, ' ').trim()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { htmlToText };
|
|
36
|
+
//# sourceMappingURL=htmlToText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmlToText.js","sources":["../../../src/utils/htmlToText.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Rendered HTML to inert one-line text, read by the browser's HTML parser\n * rather than by tag patterns, so a split or unclosed tag cannot slip through\n * and a long hostile input stays linear.\n */\n\nconst DROPPED = 'script, style, noscript, template'\n\n/**\n * Reduce HTML to its visible text: script, style, noscript and template\n * content is dropped, comments are skipped, entities are decoded, and every\n * element boundary reads as one space.\n *\n * @param {unknown} html Rendered HTML or plain text.\n * @return {string} The text on one line, trimmed.\n */\nexport function htmlToText(html) {\n\tconst source = html === null || html === undefined ? '' : String(html)\n\tif (source === '') {\n\t\treturn ''\n\t}\n\tconst doc = new DOMParser().parseFromString(source, 'text/html')\n\tdoc.querySelectorAll(DROPPED).forEach((node) => node.remove())\n\tconst parts = []\n\tconst walker = doc.createTreeWalker(doc.documentElement, NodeFilter.SHOW_TEXT)\n\twhile (walker.nextNode()) {\n\t\tparts.push(walker.currentNode.nodeValue)\n\t}\n\treturn parts.join(' ').replace(/\\s+/g, ' ').trim()\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAG,oCAAmC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAE;AACjC,CAAC,MAAM,MAAM,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,EAAC;AACvE,CAAC,IAAI,MAAM,KAAK,EAAE,EAAE;AACpB,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,MAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,WAAW,EAAC;AACjE,CAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,EAAC;AAC/D,CAAC,MAAM,KAAK,GAAG,GAAE;AACjB,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,SAAS,EAAC;AAC/E,CAAC,OAAO,MAAM,CAAC,QAAQ,EAAE,EAAE;AAC3B,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAC;AAC1C,EAAE;AACF,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE;AACnD;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
4
|
+
*
|
|
5
|
+
* Keys that reach an object's prototype when used as a property name.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Whether writing under this key would reach a prototype instead of an own
|
|
10
|
+
* property (`__proto__`, `constructor`, `prototype`).
|
|
11
|
+
*
|
|
12
|
+
* @param {unknown} key A property name, path segment or cell name.
|
|
13
|
+
* @return {boolean} True for a key an editor must not write under.
|
|
14
|
+
*/
|
|
15
|
+
function isPrototypeKey(key) {
|
|
16
|
+
return key === '__proto__' || key === 'constructor' || key === 'prototype'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { isPrototypeKey };
|
|
20
|
+
//# sourceMappingURL=prototypeKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prototypeKeys.js","sources":["../../../src/utils/prototypeKeys.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Keys that reach an object's prototype when used as a property name.\n */\n\n/**\n * Whether writing under this key would reach a prototype instead of an own\n * property (`__proto__`, `constructor`, `prototype`).\n *\n * @param {unknown} key A property name, path segment or cell name.\n * @return {boolean} True for a key an editor must not write under.\n */\nexport function isPrototypeKey(key) {\n\treturn key === '__proto__' || key === 'constructor' || key === 'prototype'\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,GAAG,EAAE;AACpC,CAAC,OAAO,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,WAAW;AAC3E;;;;"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { toastUiSanitizer } from './toastUiSanitizer.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
5
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
6
|
+
*
|
|
7
|
+
* Runs every raw HTML string that `@toast-ui/editor` turns into DOM through
|
|
8
|
+
* DOMPurify 3 (`toastUiSanitizer`) first.
|
|
9
|
+
*
|
|
10
|
+
* `customHTMLSanitizer` covers the preview and the HTML renderer only. When
|
|
11
|
+
* the WYSIWYG editor converts markdown (initial value, `setMarkdown`, a mode
|
|
12
|
+
* switch, `getHTML`), its raw HTML block and inline converters call the
|
|
13
|
+
* DOMPurify 2.3.3 copy inlined in the package and write the result into a
|
|
14
|
+
* `div` of the live document with `innerHTML`. The package is unmaintained,
|
|
15
|
+
* so no release fixes that, and patching the bundle would only hold where
|
|
16
|
+
* the patch is applied: each consuming app resolves and bundles
|
|
17
|
+
* `@toast-ui/editor` itself. This guard works on the editor instance, so it
|
|
18
|
+
* travels with CnMarkdownEditor into every app.
|
|
19
|
+
*
|
|
20
|
+
* What it changes, per instance:
|
|
21
|
+
* - the `htmlBlock` and `htmlInline` converters see the node's literal
|
|
22
|
+
* sanitised by DOMPurify 3 (restored afterwards, so the markdown source and
|
|
23
|
+
* its syntax tree stay untouched);
|
|
24
|
+
* - pasted HTML is sanitised after Toast UI's own clean-up and before
|
|
25
|
+
* ProseMirror parses it;
|
|
26
|
+
* - `setHTML` sanitises its argument.
|
|
27
|
+
* DOMPurify 2.3.3 still runs inside Toast UI, but only on output DOMPurify 3
|
|
28
|
+
* already produced.
|
|
29
|
+
*
|
|
30
|
+
* @module utils/toastUiRawHtmlGuard
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
// Toast UI's own tag grammar (`reHTMLTag`): its converters read the tag name
|
|
35
|
+
// with it and throw when a literal does not start with a tag.
|
|
36
|
+
const TAG_NAME = '[A-Za-z][A-Za-z0-9-]*';
|
|
37
|
+
const ATTRIBUTE = '(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"\'=<>`\\x00-\\x20]+|\'[^\']*\'|"[^"]*"))?)';
|
|
38
|
+
const OPEN_TAG = new RegExp(`^<(${TAG_NAME})${ATTRIBUTE}*\\s*/?>`, 'i');
|
|
39
|
+
const CLOSE_TAG = new RegExp(`^</(${TAG_NAME})\\s*>`, 'i');
|
|
40
|
+
// Toast UI renders a block holding a comment as plain text.
|
|
41
|
+
const HTML_COMMENT = /<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/;
|
|
42
|
+
|
|
43
|
+
// An opening tag no Toast UI converter or schema mark handles: converting it
|
|
44
|
+
// adds nothing, which is what the sanitiser asked for.
|
|
45
|
+
const INERT_OPEN_TAG = '<span>';
|
|
46
|
+
|
|
47
|
+
const GUARDED = Symbol('cnToastUiRawHtmlGuard');
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The literal of a raw HTML block, sanitised.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} literal The block's source HTML.
|
|
53
|
+
* @return {string} HTML that starts with a tag, as Toast UI requires.
|
|
54
|
+
*/
|
|
55
|
+
function sanitizeHtmlBlockLiteral(literal) {
|
|
56
|
+
if (HTML_COMMENT.test(literal)) {
|
|
57
|
+
return literal
|
|
58
|
+
}
|
|
59
|
+
const clean = toastUiSanitizer(literal);
|
|
60
|
+
return OPEN_TAG.test(clean) ? clean : `<div>${clean}</div>`
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The literal of one raw inline HTML tag, sanitised.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} literal The tag's source, e.g. `<img src=x>` or `</b>`.
|
|
67
|
+
* @return {string} The sanitised tag.
|
|
68
|
+
*/
|
|
69
|
+
function sanitizeHtmlInlineLiteral(literal) {
|
|
70
|
+
const close = CLOSE_TAG.exec(literal);
|
|
71
|
+
if (close) {
|
|
72
|
+
return `</${close[1]}>`
|
|
73
|
+
}
|
|
74
|
+
if (!OPEN_TAG.test(literal)) {
|
|
75
|
+
return literal
|
|
76
|
+
}
|
|
77
|
+
const open = OPEN_TAG.exec(toastUiSanitizer(literal));
|
|
78
|
+
return open ? open[0] : INERT_OPEN_TAG
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Wrap one markdown-to-WYSIWYG converter so it reads a sanitised literal.
|
|
83
|
+
*
|
|
84
|
+
* @param {object} convertors The instance's `toWwConvertors` map.
|
|
85
|
+
* @param {string} type `htmlBlock` or `htmlInline`.
|
|
86
|
+
* @param {(literal: string) => string} sanitize Literal sanitiser for that type.
|
|
87
|
+
* @return {void}
|
|
88
|
+
*/
|
|
89
|
+
function wrapConvertor(convertors, type, sanitize) {
|
|
90
|
+
const original = convertors[type];
|
|
91
|
+
if (typeof original !== 'function') {
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
convertors[type] = function(state, node, context) {
|
|
95
|
+
const literal = node.literal;
|
|
96
|
+
node.literal = sanitize(typeof literal === 'string' ? literal : '');
|
|
97
|
+
try {
|
|
98
|
+
return original.call(this, state, node, context)
|
|
99
|
+
} finally {
|
|
100
|
+
node.literal = literal;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Install the guard on a constructed Toast UI editor. Safe to call more than
|
|
107
|
+
* once; does nothing on an object without Toast UI's internals.
|
|
108
|
+
*
|
|
109
|
+
* @param {object} editor A `@toast-ui/editor` instance.
|
|
110
|
+
* @return {object} The same editor.
|
|
111
|
+
*/
|
|
112
|
+
function guardToastUiEditor(editor) {
|
|
113
|
+
if (!editor || editor[GUARDED]) {
|
|
114
|
+
return editor
|
|
115
|
+
}
|
|
116
|
+
const convertors = editor.convertor && editor.convertor.toWwConvertors;
|
|
117
|
+
const view = editor.wwEditor && editor.wwEditor.view;
|
|
118
|
+
if (!convertors || !view || typeof view.setProps !== 'function') {
|
|
119
|
+
return editor
|
|
120
|
+
}
|
|
121
|
+
wrapConvertor(convertors, 'htmlBlock', sanitizeHtmlBlockLiteral);
|
|
122
|
+
wrapConvertor(convertors, 'htmlInline', sanitizeHtmlInlineLiteral);
|
|
123
|
+
|
|
124
|
+
const transformPastedHTML = view.props.transformPastedHTML;
|
|
125
|
+
view.setProps({
|
|
126
|
+
transformPastedHTML(html, pmView) {
|
|
127
|
+
const cleaned = typeof transformPastedHTML === 'function' ? transformPastedHTML(html, pmView) : html;
|
|
128
|
+
return toastUiSanitizer(cleaned)
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
editor[GUARDED] = true;
|
|
133
|
+
return editor
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* A subclass of the Toast UI editor class with the guard installed.
|
|
138
|
+
*
|
|
139
|
+
* The constructor converts `initialValue` through `setMarkdown` before it
|
|
140
|
+
* returns, so the guard is installed from that override, ahead of the first
|
|
141
|
+
* conversion.
|
|
142
|
+
*
|
|
143
|
+
* @param {new (options?: object) => object} Editor The `@toast-ui/editor` default export.
|
|
144
|
+
* @return {new (options?: object) => object} The guarded editor class.
|
|
145
|
+
*/
|
|
146
|
+
function guardedToastUiEditorClass(Editor) {
|
|
147
|
+
return class GuardedToastUiEditor extends Editor {
|
|
148
|
+
constructor(options) {
|
|
149
|
+
super(options);
|
|
150
|
+
guardToastUiEditor(this);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
setMarkdown(markdown, cursorToEnd) {
|
|
154
|
+
guardToastUiEditor(this);
|
|
155
|
+
return super.setMarkdown(markdown, cursorToEnd)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
setHTML(html, cursorToEnd) {
|
|
159
|
+
guardToastUiEditor(this);
|
|
160
|
+
return super.setHTML(toastUiSanitizer(html), cursorToEnd)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { guardToastUiEditor, guardedToastUiEditorClass, sanitizeHtmlBlockLiteral, sanitizeHtmlInlineLiteral };
|
|
166
|
+
//# sourceMappingURL=toastUiRawHtmlGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toastUiRawHtmlGuard.js","sources":["../../../src/utils/toastUiRawHtmlGuard.js"],"sourcesContent":["/**\n * SPDX-License-Identifier: EUPL-1.2\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n *\n * Runs every raw HTML string that `@toast-ui/editor` turns into DOM through\n * DOMPurify 3 (`toastUiSanitizer`) first.\n *\n * `customHTMLSanitizer` covers the preview and the HTML renderer only. When\n * the WYSIWYG editor converts markdown (initial value, `setMarkdown`, a mode\n * switch, `getHTML`), its raw HTML block and inline converters call the\n * DOMPurify 2.3.3 copy inlined in the package and write the result into a\n * `div` of the live document with `innerHTML`. The package is unmaintained,\n * so no release fixes that, and patching the bundle would only hold where\n * the patch is applied: each consuming app resolves and bundles\n * `@toast-ui/editor` itself. This guard works on the editor instance, so it\n * travels with CnMarkdownEditor into every app.\n *\n * What it changes, per instance:\n * - the `htmlBlock` and `htmlInline` converters see the node's literal\n * sanitised by DOMPurify 3 (restored afterwards, so the markdown source and\n * its syntax tree stay untouched);\n * - pasted HTML is sanitised after Toast UI's own clean-up and before\n * ProseMirror parses it;\n * - `setHTML` sanitises its argument.\n * DOMPurify 2.3.3 still runs inside Toast UI, but only on output DOMPurify 3\n * already produced.\n *\n * @module utils/toastUiRawHtmlGuard\n */\n\nimport { toastUiSanitizer } from './toastUiSanitizer.js'\n\n// Toast UI's own tag grammar (`reHTMLTag`): its converters read the tag name\n// with it and throw when a literal does not start with a tag.\nconst TAG_NAME = '[A-Za-z][A-Za-z0-9-]*'\nconst ATTRIBUTE = '(?:\\\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\\\s*=\\\\s*(?:[^\"\\'=<>`\\\\x00-\\\\x20]+|\\'[^\\']*\\'|\"[^\"]*\"))?)'\nconst OPEN_TAG = new RegExp(`^<(${TAG_NAME})${ATTRIBUTE}*\\\\s*/?>`, 'i')\nconst CLOSE_TAG = new RegExp(`^</(${TAG_NAME})\\\\s*>`, 'i')\n// Toast UI renders a block holding a comment as plain text.\nconst HTML_COMMENT = /<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/\n\n// An opening tag no Toast UI converter or schema mark handles: converting it\n// adds nothing, which is what the sanitiser asked for.\nconst INERT_OPEN_TAG = '<span>'\n\nconst GUARDED = Symbol('cnToastUiRawHtmlGuard')\n\n/**\n * The literal of a raw HTML block, sanitised.\n *\n * @param {string} literal The block's source HTML.\n * @return {string} HTML that starts with a tag, as Toast UI requires.\n */\nexport function sanitizeHtmlBlockLiteral(literal) {\n\tif (HTML_COMMENT.test(literal)) {\n\t\treturn literal\n\t}\n\tconst clean = toastUiSanitizer(literal)\n\treturn OPEN_TAG.test(clean) ? clean : `<div>${clean}</div>`\n}\n\n/**\n * The literal of one raw inline HTML tag, sanitised.\n *\n * @param {string} literal The tag's source, e.g. `<img src=x>` or `</b>`.\n * @return {string} The sanitised tag.\n */\nexport function sanitizeHtmlInlineLiteral(literal) {\n\tconst close = CLOSE_TAG.exec(literal)\n\tif (close) {\n\t\treturn `</${close[1]}>`\n\t}\n\tif (!OPEN_TAG.test(literal)) {\n\t\treturn literal\n\t}\n\tconst open = OPEN_TAG.exec(toastUiSanitizer(literal))\n\treturn open ? open[0] : INERT_OPEN_TAG\n}\n\n/**\n * Wrap one markdown-to-WYSIWYG converter so it reads a sanitised literal.\n *\n * @param {object} convertors The instance's `toWwConvertors` map.\n * @param {string} type `htmlBlock` or `htmlInline`.\n * @param {(literal: string) => string} sanitize Literal sanitiser for that type.\n * @return {void}\n */\nfunction wrapConvertor(convertors, type, sanitize) {\n\tconst original = convertors[type]\n\tif (typeof original !== 'function') {\n\t\treturn\n\t}\n\tconvertors[type] = function(state, node, context) {\n\t\tconst literal = node.literal\n\t\tnode.literal = sanitize(typeof literal === 'string' ? literal : '')\n\t\ttry {\n\t\t\treturn original.call(this, state, node, context)\n\t\t} finally {\n\t\t\tnode.literal = literal\n\t\t}\n\t}\n}\n\n/**\n * Install the guard on a constructed Toast UI editor. Safe to call more than\n * once; does nothing on an object without Toast UI's internals.\n *\n * @param {object} editor A `@toast-ui/editor` instance.\n * @return {object} The same editor.\n */\nexport function guardToastUiEditor(editor) {\n\tif (!editor || editor[GUARDED]) {\n\t\treturn editor\n\t}\n\tconst convertors = editor.convertor && editor.convertor.toWwConvertors\n\tconst view = editor.wwEditor && editor.wwEditor.view\n\tif (!convertors || !view || typeof view.setProps !== 'function') {\n\t\treturn editor\n\t}\n\twrapConvertor(convertors, 'htmlBlock', sanitizeHtmlBlockLiteral)\n\twrapConvertor(convertors, 'htmlInline', sanitizeHtmlInlineLiteral)\n\n\tconst transformPastedHTML = view.props.transformPastedHTML\n\tview.setProps({\n\t\ttransformPastedHTML(html, pmView) {\n\t\t\tconst cleaned = typeof transformPastedHTML === 'function' ? transformPastedHTML(html, pmView) : html\n\t\t\treturn toastUiSanitizer(cleaned)\n\t\t},\n\t})\n\n\teditor[GUARDED] = true\n\treturn editor\n}\n\n/**\n * A subclass of the Toast UI editor class with the guard installed.\n *\n * The constructor converts `initialValue` through `setMarkdown` before it\n * returns, so the guard is installed from that override, ahead of the first\n * conversion.\n *\n * @param {new (options?: object) => object} Editor The `@toast-ui/editor` default export.\n * @return {new (options?: object) => object} The guarded editor class.\n */\nexport function guardedToastUiEditorClass(Editor) {\n\treturn class GuardedToastUiEditor extends Editor {\n\t\tconstructor(options) {\n\t\t\tsuper(options)\n\t\t\tguardToastUiEditor(this)\n\t\t}\n\n\t\tsetMarkdown(markdown, cursorToEnd) {\n\t\t\tguardToastUiEditor(this)\n\t\t\treturn super.setMarkdown(markdown, cursorToEnd)\n\t\t}\n\n\t\tsetHTML(html, cursorToEnd) {\n\t\t\tguardToastUiEditor(this)\n\t\t\treturn super.setHTML(toastUiSanitizer(html), cursorToEnd)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,wBAAuB;AACxC,MAAM,SAAS,GAAG,gGAA+F;AACjH,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAC;AACvE,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAC;AAC1D;AACA,MAAM,YAAY,GAAG,yCAAwC;AAC7D;AACA;AACA;AACA,MAAM,cAAc,GAAG,SAAQ;AAC/B;AACA,MAAM,OAAO,GAAG,MAAM,CAAC,uBAAuB,EAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,OAAO,EAAE;AAClD,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;AACjC,EAAE,OAAO,OAAO;AAChB,EAAE;AACF,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,EAAC;AACxC,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,OAA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