@conduction/nextcloud-vue 2.161.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/CnActionsMenu/CnActionsMenu.vue2.js +3 -2
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js +2 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js.map +1 -1
- 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/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +8 -8
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +23 -0
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +48 -5
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +2 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +4 -3
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js +2 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js +2 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue3.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/CnFlowRunsWidget/CnFlowRunsWidget.vue.js +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js +41 -39
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.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 +87 -11
- 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/CnMenuWidget/menuActive.js +2 -1
- package/dist/esm/components/CnMenuWidget/menuActive.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/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +39 -2
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue.js +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.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/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +5 -5
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.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/email/CnEmailTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +130 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js +27 -16
- package/dist/esm/integrations/builtin/email/CnEmailTab.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 +17 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +17 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1038 -822
- package/dist/esm/utils/buildManifestRoutes.js +2 -1
- package/dist/esm/utils/buildManifestRoutes.js.map +1 -1
- package/dist/esm/utils/cnFetch.js +1 -15
- package/dist/esm/utils/cnFetch.js.map +1 -1
- package/dist/esm/utils/fillTemplate.js +32 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/forge.js +4 -1
- package/dist/esm/utils/forge.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/myTeam.js +17 -3
- package/dist/esm/utils/myTeam.js.map +1 -1
- package/dist/esm/utils/prototypeKeys.js +20 -0
- package/dist/esm/utils/prototypeKeys.js.map +1 -0
- package/dist/esm/utils/rowAggregate.js +20 -1
- package/dist/esm/utils/rowAggregate.js.map +1 -1
- package/dist/esm/utils/toastUiRawHtmlGuard.js +166 -0
- package/dist/esm/utils/toastUiRawHtmlGuard.js.map +1 -0
- package/dist/esm/utils/trailingSlashes.js +24 -0
- package/dist/esm/utils/trailingSlashes.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +12490 -11295
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1038 -822
- package/l10n/en.json +17 -1
- package/l10n/nl.json +17 -1
- package/package.json +1 -1
- package/src/components/CnActionsMenu/CnActionsMenu.vue +3 -2
- package/src/components/CnAddressSearch/CnAddressSearch.vue +2 -1
- package/src/components/CnChipListManager/CnChipListManager.vue +504 -0
- package/src/components/CnChipListManager/index.js +4 -0
- package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
- package/src/components/CnDataTable/CnDataTable.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +23 -0
- package/src/components/CnFactsWidget/CnFactsWidget.vue +49 -5
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +4 -3
- package/src/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/src/components/CnFilesBrowser/openRegisterSource.js +2 -1
- package/src/components/CnFilesWidget/CnFilesWidget.vue +2 -1
- package/src/components/CnFilterRowsEditor/CnFilterRowsEditor.vue +4 -0
- package/src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue +1 -1
- package/src/components/CnFolderSidebar/webdavFolders.js +2 -1
- 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 +89 -13
- package/src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue +2 -1
- package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +6 -1
- package/src/components/CnMenuWidget/menuActive.js +2 -1
- package/src/components/CnObjectListWidget/CnObjectListWidget.vue +1 -1
- package/src/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue +4 -0
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +40 -3
- package/src/components/CnPageTreeNode/CnPageTreeNode.vue +2 -1
- package/src/components/CnPageTreeNode/CnPageTreeRow.vue +10 -1
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +5 -5
- 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/dialog.css +7 -0
- package/src/css/look-board-detail.css +41 -4
- package/src/css/look-board.css +64 -2
- 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/email/CnEmailTab.vue +155 -4
- 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/buildManifestRoutes.js +2 -1
- package/src/utils/cnFetch.js +3 -15
- package/src/utils/fillTemplate.js +32 -2
- package/src/utils/forge.js +3 -1
- package/src/utils/htmlToText.js +33 -0
- package/src/utils/myTeam.js +17 -3
- package/src/utils/prototypeKeys.js +17 -0
- package/src/utils/rowAggregate.js +19 -0
- package/src/utils/toastUiRawHtmlGuard.js +162 -0
- package/src/utils/trailingSlashes.js +21 -0
|
@@ -302,6 +302,34 @@ export function firstFilled(templates, object, translate = (key) => key, now = n
|
|
|
302
302
|
return ''
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Split a template into literal, field, literal, … as
|
|
307
|
+
* `template.split(/\{([^}]+)\}/)` does, in one linear pass.
|
|
308
|
+
*
|
|
309
|
+
* @param {string} template The template, with `{field}` placeholders.
|
|
310
|
+
* @return {string[]} The literals at even indexes, the field names at odd ones.
|
|
311
|
+
*/
|
|
312
|
+
function splitFields(template) {
|
|
313
|
+
const parts = []
|
|
314
|
+
let literalStart = 0
|
|
315
|
+
let open = template.indexOf('{')
|
|
316
|
+
while (open !== -1) {
|
|
317
|
+
const close = template.indexOf('}', open + 1)
|
|
318
|
+
if (close === -1) {
|
|
319
|
+
break
|
|
320
|
+
}
|
|
321
|
+
if (close === open + 1) {
|
|
322
|
+
open = template.indexOf('{', close + 1)
|
|
323
|
+
continue
|
|
324
|
+
}
|
|
325
|
+
parts.push(template.slice(literalStart, open), template.slice(open + 1, close))
|
|
326
|
+
literalStart = close + 1
|
|
327
|
+
open = template.indexOf('{', literalStart)
|
|
328
|
+
}
|
|
329
|
+
parts.push(template.slice(literalStart))
|
|
330
|
+
return parts
|
|
331
|
+
}
|
|
332
|
+
|
|
305
333
|
/**
|
|
306
334
|
* Fill a template such as `"{identifier} · {requester}"` field by field
|
|
307
335
|
* (a table column's `secondary` line, a detail page's meta line).
|
|
@@ -319,8 +347,10 @@ export function firstFilled(templates, object, translate = (key) => key, now = n
|
|
|
319
347
|
* @return {string} The filled template.
|
|
320
348
|
*/
|
|
321
349
|
export function joinTemplateParts(template, valueOf) {
|
|
322
|
-
|
|
323
|
-
|
|
350
|
+
const parts = splitFields(template)
|
|
351
|
+
if (parts.length === 1) {
|
|
352
|
+
return parts[0]
|
|
353
|
+
}
|
|
324
354
|
const lead = parts[0]
|
|
325
355
|
const tail = parts[parts.length - 1]
|
|
326
356
|
let body = ''
|
package/src/utils/forge.js
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* else in the suggestion flow needs to change.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
import { stripTrailingSlashes } from './trailingSlashes.js'
|
|
29
|
+
|
|
28
30
|
/**
|
|
29
31
|
* Default host per forge type. `forgejo`/`gitea` are self-hosted, so they
|
|
30
32
|
* have no canonical public host — a `baseUrl` MUST be supplied for those.
|
|
@@ -101,7 +103,7 @@ export function resolveForge(forge) {
|
|
|
101
103
|
const baseUrl = (forge && forge.baseUrl)
|
|
102
104
|
|| FORGE_DEFAULT_BASE_URLS[type]
|
|
103
105
|
|| DEFAULT_FORGE.baseUrl
|
|
104
|
-
return { type, baseUrl: baseUrl
|
|
106
|
+
return { type, baseUrl: stripTrailingSlashes(baseUrl) }
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
/**
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
|
+
* SPDX-License-Identifier: EUPL-1.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
|
+
export 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
|
+
}
|
package/src/utils/myTeam.js
CHANGED
|
@@ -194,7 +194,21 @@ export function fillMyTeamToken(text, name) {
|
|
|
194
194
|
if (typeof text !== 'string' || !text.includes('{myTeam}')) {
|
|
195
195
|
return text
|
|
196
196
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
let out = ''
|
|
198
|
+
let pos = 0
|
|
199
|
+
for (;;) {
|
|
200
|
+
const open = text.indexOf('[', pos)
|
|
201
|
+
const close = open === -1 ? -1 : text.indexOf(']', open + 1)
|
|
202
|
+
if (close === -1) {
|
|
203
|
+
break
|
|
204
|
+
}
|
|
205
|
+
const part = text.slice(open + 1, close)
|
|
206
|
+
if (part.includes('{myTeam}')) {
|
|
207
|
+
out += text.slice(pos, open) + (name ? part.replaceAll('{myTeam}', name) : '')
|
|
208
|
+
} else {
|
|
209
|
+
out += text.slice(pos, close + 1)
|
|
210
|
+
}
|
|
211
|
+
pos = close + 1
|
|
212
|
+
}
|
|
213
|
+
return (out + text.slice(pos)).replaceAll('{myTeam}', name)
|
|
200
214
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export function isPrototypeKey(key) {
|
|
16
|
+
return key === '__proto__' || key === 'constructor' || key === 'prototype'
|
|
17
|
+
}
|
|
@@ -26,6 +26,25 @@ export function isRowAggregate(agg) {
|
|
|
26
26
|
return Boolean(agg && agg.register && agg.schema && (agg.op === 'count' || (agg.op === 'max' && agg.field)))
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* One row's figures in a map of rows, created on first use. Rows live in a
|
|
31
|
+
* Map and figures in a prototype-less object, so a row id or figure key such
|
|
32
|
+
* as `__proto__` stays an ordinary key.
|
|
33
|
+
*
|
|
34
|
+
* @param {Map<string, object>} rows The figures by row id.
|
|
35
|
+
* @param {string|number} rowId The row id (read as a string).
|
|
36
|
+
* @return {object} The row's figures, by key.
|
|
37
|
+
*/
|
|
38
|
+
export function cellsOf(rows, rowId) {
|
|
39
|
+
const key = String(rowId)
|
|
40
|
+
let cells = rows.get(key)
|
|
41
|
+
if (!cells) {
|
|
42
|
+
cells = Object.create(null)
|
|
43
|
+
rows.set(key, cells)
|
|
44
|
+
}
|
|
45
|
+
return cells
|
|
46
|
+
}
|
|
47
|
+
|
|
29
48
|
/**
|
|
30
49
|
* Fill an aggregate's `where` for one row: a string `"@self.<path>"` reads
|
|
31
50
|
* that path of the row, everything else is passed through.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
3
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
4
|
+
*
|
|
5
|
+
* Runs every raw HTML string that `@toast-ui/editor` turns into DOM through
|
|
6
|
+
* DOMPurify 3 (`toastUiSanitizer`) first.
|
|
7
|
+
*
|
|
8
|
+
* `customHTMLSanitizer` covers the preview and the HTML renderer only. When
|
|
9
|
+
* the WYSIWYG editor converts markdown (initial value, `setMarkdown`, a mode
|
|
10
|
+
* switch, `getHTML`), its raw HTML block and inline converters call the
|
|
11
|
+
* DOMPurify 2.3.3 copy inlined in the package and write the result into a
|
|
12
|
+
* `div` of the live document with `innerHTML`. The package is unmaintained,
|
|
13
|
+
* so no release fixes that, and patching the bundle would only hold where
|
|
14
|
+
* the patch is applied: each consuming app resolves and bundles
|
|
15
|
+
* `@toast-ui/editor` itself. This guard works on the editor instance, so it
|
|
16
|
+
* travels with CnMarkdownEditor into every app.
|
|
17
|
+
*
|
|
18
|
+
* What it changes, per instance:
|
|
19
|
+
* - the `htmlBlock` and `htmlInline` converters see the node's literal
|
|
20
|
+
* sanitised by DOMPurify 3 (restored afterwards, so the markdown source and
|
|
21
|
+
* its syntax tree stay untouched);
|
|
22
|
+
* - pasted HTML is sanitised after Toast UI's own clean-up and before
|
|
23
|
+
* ProseMirror parses it;
|
|
24
|
+
* - `setHTML` sanitises its argument.
|
|
25
|
+
* DOMPurify 2.3.3 still runs inside Toast UI, but only on output DOMPurify 3
|
|
26
|
+
* already produced.
|
|
27
|
+
*
|
|
28
|
+
* @module utils/toastUiRawHtmlGuard
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { toastUiSanitizer } from './toastUiSanitizer.js'
|
|
32
|
+
|
|
33
|
+
// Toast UI's own tag grammar (`reHTMLTag`): its converters read the tag name
|
|
34
|
+
// with it and throw when a literal does not start with a tag.
|
|
35
|
+
const TAG_NAME = '[A-Za-z][A-Za-z0-9-]*'
|
|
36
|
+
const ATTRIBUTE = '(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"\'=<>`\\x00-\\x20]+|\'[^\']*\'|"[^"]*"))?)'
|
|
37
|
+
const OPEN_TAG = new RegExp(`^<(${TAG_NAME})${ATTRIBUTE}*\\s*/?>`, 'i')
|
|
38
|
+
const CLOSE_TAG = new RegExp(`^</(${TAG_NAME})\\s*>`, 'i')
|
|
39
|
+
// Toast UI renders a block holding a comment as plain text.
|
|
40
|
+
const HTML_COMMENT = /<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/
|
|
41
|
+
|
|
42
|
+
// An opening tag no Toast UI converter or schema mark handles: converting it
|
|
43
|
+
// adds nothing, which is what the sanitiser asked for.
|
|
44
|
+
const INERT_OPEN_TAG = '<span>'
|
|
45
|
+
|
|
46
|
+
const GUARDED = Symbol('cnToastUiRawHtmlGuard')
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The literal of a raw HTML block, sanitised.
|
|
50
|
+
*
|
|
51
|
+
* @param {string} literal The block's source HTML.
|
|
52
|
+
* @return {string} HTML that starts with a tag, as Toast UI requires.
|
|
53
|
+
*/
|
|
54
|
+
export function sanitizeHtmlBlockLiteral(literal) {
|
|
55
|
+
if (HTML_COMMENT.test(literal)) {
|
|
56
|
+
return literal
|
|
57
|
+
}
|
|
58
|
+
const clean = toastUiSanitizer(literal)
|
|
59
|
+
return OPEN_TAG.test(clean) ? clean : `<div>${clean}</div>`
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The literal of one raw inline HTML tag, sanitised.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} literal The tag's source, e.g. `<img src=x>` or `</b>`.
|
|
66
|
+
* @return {string} The sanitised tag.
|
|
67
|
+
*/
|
|
68
|
+
export function sanitizeHtmlInlineLiteral(literal) {
|
|
69
|
+
const close = CLOSE_TAG.exec(literal)
|
|
70
|
+
if (close) {
|
|
71
|
+
return `</${close[1]}>`
|
|
72
|
+
}
|
|
73
|
+
if (!OPEN_TAG.test(literal)) {
|
|
74
|
+
return literal
|
|
75
|
+
}
|
|
76
|
+
const open = OPEN_TAG.exec(toastUiSanitizer(literal))
|
|
77
|
+
return open ? open[0] : INERT_OPEN_TAG
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Wrap one markdown-to-WYSIWYG converter so it reads a sanitised literal.
|
|
82
|
+
*
|
|
83
|
+
* @param {object} convertors The instance's `toWwConvertors` map.
|
|
84
|
+
* @param {string} type `htmlBlock` or `htmlInline`.
|
|
85
|
+
* @param {(literal: string) => string} sanitize Literal sanitiser for that type.
|
|
86
|
+
* @return {void}
|
|
87
|
+
*/
|
|
88
|
+
function wrapConvertor(convertors, type, sanitize) {
|
|
89
|
+
const original = convertors[type]
|
|
90
|
+
if (typeof original !== 'function') {
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
convertors[type] = function(state, node, context) {
|
|
94
|
+
const literal = node.literal
|
|
95
|
+
node.literal = sanitize(typeof literal === 'string' ? literal : '')
|
|
96
|
+
try {
|
|
97
|
+
return original.call(this, state, node, context)
|
|
98
|
+
} finally {
|
|
99
|
+
node.literal = literal
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Install the guard on a constructed Toast UI editor. Safe to call more than
|
|
106
|
+
* once; does nothing on an object without Toast UI's internals.
|
|
107
|
+
*
|
|
108
|
+
* @param {object} editor A `@toast-ui/editor` instance.
|
|
109
|
+
* @return {object} The same editor.
|
|
110
|
+
*/
|
|
111
|
+
export function guardToastUiEditor(editor) {
|
|
112
|
+
if (!editor || editor[GUARDED]) {
|
|
113
|
+
return editor
|
|
114
|
+
}
|
|
115
|
+
const convertors = editor.convertor && editor.convertor.toWwConvertors
|
|
116
|
+
const view = editor.wwEditor && editor.wwEditor.view
|
|
117
|
+
if (!convertors || !view || typeof view.setProps !== 'function') {
|
|
118
|
+
return editor
|
|
119
|
+
}
|
|
120
|
+
wrapConvertor(convertors, 'htmlBlock', sanitizeHtmlBlockLiteral)
|
|
121
|
+
wrapConvertor(convertors, 'htmlInline', sanitizeHtmlInlineLiteral)
|
|
122
|
+
|
|
123
|
+
const transformPastedHTML = view.props.transformPastedHTML
|
|
124
|
+
view.setProps({
|
|
125
|
+
transformPastedHTML(html, pmView) {
|
|
126
|
+
const cleaned = typeof transformPastedHTML === 'function' ? transformPastedHTML(html, pmView) : html
|
|
127
|
+
return toastUiSanitizer(cleaned)
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
editor[GUARDED] = true
|
|
132
|
+
return editor
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* A subclass of the Toast UI editor class with the guard installed.
|
|
137
|
+
*
|
|
138
|
+
* The constructor converts `initialValue` through `setMarkdown` before it
|
|
139
|
+
* returns, so the guard is installed from that override, ahead of the first
|
|
140
|
+
* conversion.
|
|
141
|
+
*
|
|
142
|
+
* @param {new (options?: object) => object} Editor The `@toast-ui/editor` default export.
|
|
143
|
+
* @return {new (options?: object) => object} The guarded editor class.
|
|
144
|
+
*/
|
|
145
|
+
export function guardedToastUiEditorClass(Editor) {
|
|
146
|
+
return class GuardedToastUiEditor extends Editor {
|
|
147
|
+
constructor(options) {
|
|
148
|
+
super(options)
|
|
149
|
+
guardToastUiEditor(this)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
setMarkdown(markdown, cursorToEnd) {
|
|
153
|
+
guardToastUiEditor(this)
|
|
154
|
+
return super.setMarkdown(markdown, cursorToEnd)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
setHTML(html, cursorToEnd) {
|
|
158
|
+
guardToastUiEditor(this)
|
|
159
|
+
return super.setHTML(toastUiSanitizer(html), cursorToEnd)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
4
|
+
*
|
|
5
|
+
* Trailing-slash trimming, with no imports, so any module can use it.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Drop trailing `/` characters in one linear pass (a `/\/+$/` pattern
|
|
10
|
+
* backtracks quadratically on a long run of slashes).
|
|
11
|
+
*
|
|
12
|
+
* @param {string} value The string to trim.
|
|
13
|
+
* @return {string} The string without trailing slashes.
|
|
14
|
+
*/
|
|
15
|
+
export function stripTrailingSlashes(value) {
|
|
16
|
+
let end = value.length
|
|
17
|
+
while (end > 0 && value.charCodeAt(end - 1) === 47) {
|
|
18
|
+
end--
|
|
19
|
+
}
|
|
20
|
+
return value.slice(0, end)
|
|
21
|
+
}
|