@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
|
@@ -2,7 +2,7 @@ import script from './CnLinksWidgetForm.vue2.js';
|
|
|
2
2
|
import { render } from './CnLinksWidgetForm.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-30ca960f";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { translate } from '@nextcloud/l10n';
|
|
2
2
|
import __sfc_main from '../CnIconBrowser/CnIconBrowser.vue.js';
|
|
3
|
+
import { isPrototypeKey } from '../../utils/prototypeKeys.js';
|
|
3
4
|
|
|
4
5
|
const VALID_LAYOUTS = Object.freeze(['card', 'inline', 'icon-only']);
|
|
5
6
|
const VALID_SIZES = Object.freeze(['small', 'medium', 'large']);
|
|
@@ -301,7 +302,7 @@ var script = {
|
|
|
301
302
|
return
|
|
302
303
|
}
|
|
303
304
|
const link = section.links[linkIndex];
|
|
304
|
-
if (!link) {
|
|
305
|
+
if (!link || isPrototypeKey(field)) {
|
|
305
306
|
return
|
|
306
307
|
}
|
|
307
308
|
link[field] = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnLinksWidgetForm.vue2.js","sources":["../../../../src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-links-form\">\n\t\t<!-- Sections editor -->\n\t\t<div class=\"cn-links-form__sections\">\n\t\t\t<div\n\t\t\t\tv-for=\"(section, sIdx) in sections\"\n\t\t\t\t:key=\"sIdx\"\n\t\t\t\tclass=\"cn-links-form__section\">\n\t\t\t\t<div class=\"cn-links-form__section-header\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cn-links-form__section-title\"\n\t\t\t\t\t\t:value=\"section.title\"\n\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Section title')\"\n\t\t\t\t\t\t@input=\"updateSectionTitle(sIdx, $event.target.value)\">\n\t\t\t\t\t<div class=\"cn-links-form__section-actions\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === sections.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete section')\"\n\t\t\t\t\t\t\t@click=\"deleteSection(sIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"cn-links-form__links\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(link, lIdx) in section.links\"\n\t\t\t\t\t\t:key=\"lIdx\"\n\t\t\t\t\t\tclass=\"cn-links-form__link-row\"\n\t\t\t\t\t\t:class=\"{ 'cn-links-form__link-row--invalid': linkErrors[sIdx] && linkErrors[sIdx][lIdx] }\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.label\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Label')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'label', $event.target.value)\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.url\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'URL')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'url', $event.target.value)\">\n\t\t\t\t\t\t<CnIconBrowser\n\t\t\t\t\t\t\tclass=\"cn-links-form__icon\"\n\t\t\t\t\t\t\t:value=\"link.icon\"\n\t\t\t\t\t\t\tallowUrl\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'icon', $event)\" />\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tv-if=\"showLinkDescriptions\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.description\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Description (optional)')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'description', $event.target.value)\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === section.links.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete link')\"\n\t\t\t\t\t\t\t@click=\"deleteLink(sIdx, lIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t\t\t@click=\"addLink(sIdx)\">\n\t\t\t\t\t\t+ {{ t('nextcloud-vue', 'Add link') }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t@click=\"addSection\">\n\t\t\t\t+ {{ t('nextcloud-vue', 'Add section') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<!-- Layout options panel -->\n\t\t<div class=\"cn-links-form__options\">\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Columns') }}</span>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tmax=\"6\"\n\t\t\t\t\t:value=\"columns\"\n\t\t\t\t\tclass=\"cn-links-form__input cn-links-form__input--narrow\"\n\t\t\t\t\t@input=\"updateOption('columns', clampColumns($event.target.value))\">\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Layout') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"linkLayout\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('linkLayout', $event.target.value)\">\n\t\t\t\t\t<option value=\"card\">{{ t('nextcloud-vue', 'Card') }}</option>\n\t\t\t\t\t<option value=\"inline\">{{ t('nextcloud-vue', 'Inline') }}</option>\n\t\t\t\t\t<option value=\"icon-only\">{{ t('nextcloud-vue', 'Icon only') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Icon size') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"iconSize\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('iconSize', $event.target.value)\">\n\t\t\t\t\t<option value=\"small\">{{ t('nextcloud-vue', 'Small (24 px)') }}</option>\n\t\t\t\t\t<option value=\"medium\">{{ t('nextcloud-vue', 'Medium (40 px)') }}</option>\n\t\t\t\t\t<option value=\"large\">{{ t('nextcloud-vue', 'Large (64 px)') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"openInNewTab\"\n\t\t\t\t\t@change=\"updateOption('openInNewTab', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Open in new tab') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showSectionTitles\"\n\t\t\t\t\t@change=\"updateOption('showSectionTitles', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show section titles') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showLinkDescriptions\"\n\t\t\t\t\t:disabled=\"linkLayout !== 'card'\"\n\t\t\t\t\t@change=\"updateOption('showLinkDescriptions', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show descriptions') }}</span>\n\t\t\t</label>\n\t\t</div>\n\n\t\t<p v-if=\"firstError\" class=\"cn-links-form__error\">\n\t\t\t{{ firstError }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport CnIconBrowser from '../CnIconBrowser/CnIconBrowser.vue'\n\nconst VALID_LAYOUTS = Object.freeze(['card', 'inline', 'icon-only'])\nconst VALID_SIZES = Object.freeze(['small', 'medium', 'large'])\n\nconst DEFAULT_CONTENT = Object.freeze({\n\tsections: [],\n\tcolumns: 3,\n\tlinkLayout: 'card',\n\ticonSize: 'medium',\n\topenInNewTab: true,\n\tshowSectionTitles: true,\n\tshowLinkDescriptions: true,\n})\n\n/**\n * Build an empty link row.\n *\n * @return {{label: string, url: string, icon: string, description: string}} the empty link.\n */\nfunction makeEmptyLink() {\n\treturn { label: '', url: '', icon: '', description: '' }\n}\n\n/**\n * Build an empty section with one link.\n *\n * @return {{title: string, links: object[]}} the empty section.\n */\nfunction makeEmptySection() {\n\treturn { title: '', links: [makeEmptyLink()] }\n}\n\n/**\n * URL sanitiser — accepts http(s) and root-relative URLs (without `..`).\n *\n * @param {string} url the candidate URL.\n * @return {string|null} an error message, or `null` when valid.\n */\nfunction validateUrl(url) {\n\tif (typeof url !== 'string' || url.trim() === '') {\n\t\treturn t('nextcloud-vue', 'Link URL is required')\n\t}\n\tconst trimmed = url.trim()\n\tif (trimmed.startsWith('/')) {\n\t\tif (trimmed.includes('..')) {\n\t\t\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n\t\t}\n\t\treturn null\n\t}\n\tif (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {\n\t\treturn null\n\t}\n\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n}\n\n/**\n * CnLinksWidgetForm — sub-form for creating or editing a `links` placement.\n *\n * Edits sections + links inline plus the global layout options (columns,\n * linkLayout, iconSize, openInNewTab, showSectionTitles, showLinkDescriptions).\n * `validate()` runs URL sanitisation and returns a non-empty error array when\n * any link URL is empty or unsafe. Uses up/down arrow buttons for reorder\n * (keyboard-accessible by default).\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnLinksWidgetForm',\n\n\tcomponents: {\n\t\tCnIconBrowser,\n\t},\n\n\tprops: {\n\t\t/** The placement being edited, or `null` in create mode. */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Initial content values (registry defaults when not editing). */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted on every change with the assembled content payload.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\treturn {\n\t\t\tsections: Array.isArray(initial.sections) && initial.sections.length > 0\n\t\t\t\t? this.cloneSections(initial.sections)\n\t\t\t\t: [],\n\n\t\t\tcolumns: this.clampColumns(initial.columns ?? DEFAULT_CONTENT.columns),\n\t\t\tlinkLayout: VALID_LAYOUTS.includes(initial.linkLayout)\n\t\t\t\t? initial.linkLayout\n\t\t\t\t: DEFAULT_CONTENT.linkLayout,\n\n\t\t\ticonSize: VALID_SIZES.includes(initial.iconSize)\n\t\t\t\t? initial.iconSize\n\t\t\t\t: DEFAULT_CONTENT.iconSize,\n\n\t\t\topenInNewTab: initial.openInNewTab === undefined ? DEFAULT_CONTENT.openInNewTab : Boolean(initial.openInNewTab),\n\t\t\tshowSectionTitles: initial.showSectionTitles === undefined ? DEFAULT_CONTENT.showSectionTitles : Boolean(initial.showSectionTitles),\n\t\t\tshowLinkDescriptions: initial.showLinkDescriptions === undefined ? DEFAULT_CONTENT.showLinkDescriptions : Boolean(initial.showLinkDescriptions),\n\t\t\tlinkErrors: [],\n\t\t\tfirstError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The assembled `content` payload emitted to the parent.\n\t\t *\n\t\t * @return {object} the content blob.\n\t\t */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tsections: this.cloneSections(this.sections),\n\t\t\t\tcolumns: this.columns,\n\t\t\t\tlinkLayout: this.linkLayout,\n\t\t\t\ticonSize: this.iconSize,\n\t\t\t\topenInNewTab: this.openInNewTab,\n\t\t\t\tshowSectionTitles: this.showSectionTitles,\n\t\t\t\tshowLinkDescriptions: this.showLinkDescriptions,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Deep-clone the sections into a normalised shape.\n\t\t *\n\t\t * @param {object[]} sections the sections to clone.\n\t\t * @return {Array<{title: string, links: object[]}>} the cloned sections.\n\t\t */\n\t\tcloneSections(sections) {\n\t\t\treturn sections.map((section) => ({\n\t\t\t\ttitle: typeof section?.title === 'string' ? section.title : '',\n\t\t\t\tlinks: Array.isArray(section?.links)\n\t\t\t\t\t? section.links.map((link) => ({\n\t\t\t\t\t\t\tlabel: typeof link?.label === 'string' ? link.label : '',\n\t\t\t\t\t\t\turl: typeof link?.url === 'string' ? link.url : '',\n\t\t\t\t\t\t\ticon: typeof link?.icon === 'string' ? link.icon : '',\n\t\t\t\t\t\t\tdescription: typeof link?.description === 'string' ? link.description : '',\n\t\t\t\t\t\t}))\n\t\t\t\t\t: [],\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Clamp the column count to 1–6.\n\t\t *\n\t\t * @param {unknown} value the candidate column count.\n\t\t * @return {number} the clamped column count.\n\t\t */\n\t\tclampColumns(value) {\n\t\t\tconst num = Number(value)\n\t\t\tif (!Number.isFinite(num)) {\n\t\t\t\treturn DEFAULT_CONTENT.columns\n\t\t\t}\n\t\t\treturn Math.max(1, Math.min(6, Math.round(num)))\n\t\t},\n\n\t\t/**\n\t\t * Emit `update:content` with the current assembled payload.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\temitUpdate() {\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Append a new section, then emit.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\taddSection() {\n\t\t\tthis.sections.push(makeEmptySection())\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Delete a section, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteSection(index) {\n\t\t\tthis.sections.splice(index, 1)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Move a section up or down, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveSection(index, delta) {\n\t\t\tconst target = index + delta\n\t\t\tif (target < 0 || target >= this.sections.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = this.sections.splice(index, 1)\n\t\t\tthis.sections.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a section title, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {string} title the new title.\n\t\t * @return {void}\n\t\t */\n\t\tupdateSectionTitle(index, title) {\n\t\t\tif (this.sections[index]) {\n\t\t\t\tthis.sections[index].title = title\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Append a link to a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @return {void}\n\t\t */\n\t\taddLink(sectionIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section) {\n\t\t\t\tsection.links.push(makeEmptyLink())\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a link from a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteLink(sectionIndex, linkIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section && section.links[linkIndex] !== undefined) {\n\t\t\t\tsection.links.splice(linkIndex, 1)\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Move a link up or down within its section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveLink(sectionIndex, linkIndex, delta) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst target = linkIndex + delta\n\t\t\tif (target < 0 || target >= section.links.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = section.links.splice(linkIndex, 1)\n\t\t\tsection.links.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update one field of one link, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {string} field the link field.\n\t\t * @param {string} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateLink(sectionIndex, linkIndex, field, value) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst link = section.links[linkIndex]\n\t\t\tif (!link) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlink[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a global layout option, then emit.\n\t\t *\n\t\t * @param {string} field the option field.\n\t\t * @param {unknown} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateOption(field, value) {\n\t\t\tif (field === 'linkLayout' && !VALID_LAYOUTS.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (field === 'iconSize' && !VALID_SIZES.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Validate every link URL across every section. Empty sections are\n\t\t * skipped (the renderer hides them anyway).\n\t\t *\n\t\t * @return {string[]} the validation errors (empty when valid).\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = []\n\t\t\tconst linkErrors = []\n\t\t\tthis.sections.forEach((section, sIdx) => {\n\t\t\t\tconst sectionErrors = []\n\t\t\t\tif (!Array.isArray(section.links)) {\n\t\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tsection.links.forEach((link, lIdx) => {\n\t\t\t\t\tif (typeof link.label !== 'string' || link.label.trim() === '') {\n\t\t\t\t\t\tconst msg = t('nextcloud-vue', 'Link label is required')\n\t\t\t\t\t\tsectionErrors[lIdx] = msg\n\t\t\t\t\t\terrors.push(msg)\n\t\t\t\t\t}\n\t\t\t\t\tconst urlError = validateUrl(link.url)\n\t\t\t\t\tif (urlError) {\n\t\t\t\t\t\tsectionErrors[lIdx] = urlError\n\t\t\t\t\t\terrors.push(urlError)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t})\n\t\t\tthis.linkErrors = linkErrors\n\t\t\tthis.firstError = errors.length > 0 ? errors[0] : ''\n\t\t\treturn errors\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-links-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n\n.cn-links-form__sections {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-links-form__section {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tpadding: 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius, 4px);\n\tbackground-color: var(--color-background-hover);\n}\n\n.cn-links-form__section-header {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: center;\n}\n\n.cn-links-form__section-title {\n\tflex: 1;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-links-form__section-actions {\n\tdisplay: flex;\n\tgap: 4px;\n}\n\n.cn-links-form__links {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding-left: 8px;\n}\n\n.cn-links-form__link-row {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n\tflex-wrap: wrap;\n}\n\n.cn-links-form__input {\n\tflex: 1;\n\tmin-width: 80px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-size: 13px;\n}\n\n.cn-links-form__link-row--invalid .cn-links-form__input {\n\tborder-color: var(--color-error);\n}\n\n.cn-links-form__input--narrow {\n\tflex: 0 0 auto;\n\twidth: 110px;\n}\n\n.cn-links-form__btn {\n\tpadding: 4px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n\tfont-size: 13px;\n}\n\n.cn-links-form__btn--small {\n\tpadding: 2px 6px;\n\tfont-size: 12px;\n}\n\n.cn-links-form__btn--ghost {\n\tborder-style: dashed;\n\tbackground-color: transparent;\n\talign-self: flex-start;\n}\n\n.cn-links-form__btn--danger {\n\tborder-color: var(--color-error);\n\tcolor: var(--color-error);\n}\n\n.cn-links-form__btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n.cn-links-form__options {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\tgap: 12px;\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-links-form__option {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 13px;\n}\n\n.cn-links-form__option--checkbox {\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n}\n\n.cn-links-form__error {\n\tmargin: 0;\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n}\n</style>\n"],"names":["t","CnIconBrowser"],"mappings":";;;AA8LA,MAAM,aAAc,GAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAA;AACnE,MAAM,WAAU,GAAI,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAA;;AAE9D,MAAM,e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F;;;;"}
|
|
1
|
+
{"version":3,"file":"CnLinksWidgetForm.vue2.js","sources":["../../../../src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-links-form\">\n\t\t<!-- Sections editor -->\n\t\t<div class=\"cn-links-form__sections\">\n\t\t\t<div\n\t\t\t\tv-for=\"(section, sIdx) in sections\"\n\t\t\t\t:key=\"sIdx\"\n\t\t\t\tclass=\"cn-links-form__section\">\n\t\t\t\t<div class=\"cn-links-form__section-header\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cn-links-form__section-title\"\n\t\t\t\t\t\t:value=\"section.title\"\n\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Section title')\"\n\t\t\t\t\t\t@input=\"updateSectionTitle(sIdx, $event.target.value)\">\n\t\t\t\t\t<div class=\"cn-links-form__section-actions\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === sections.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete section')\"\n\t\t\t\t\t\t\t@click=\"deleteSection(sIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"cn-links-form__links\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(link, lIdx) in section.links\"\n\t\t\t\t\t\t:key=\"lIdx\"\n\t\t\t\t\t\tclass=\"cn-links-form__link-row\"\n\t\t\t\t\t\t:class=\"{ 'cn-links-form__link-row--invalid': linkErrors[sIdx] && linkErrors[sIdx][lIdx] }\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.label\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Label')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'label', $event.target.value)\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.url\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'URL')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'url', $event.target.value)\">\n\t\t\t\t\t\t<CnIconBrowser\n\t\t\t\t\t\t\tclass=\"cn-links-form__icon\"\n\t\t\t\t\t\t\t:value=\"link.icon\"\n\t\t\t\t\t\t\tallowUrl\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'icon', $event)\" />\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tv-if=\"showLinkDescriptions\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.description\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Description (optional)')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'description', $event.target.value)\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === section.links.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete link')\"\n\t\t\t\t\t\t\t@click=\"deleteLink(sIdx, lIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t\t\t@click=\"addLink(sIdx)\">\n\t\t\t\t\t\t+ {{ t('nextcloud-vue', 'Add link') }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t@click=\"addSection\">\n\t\t\t\t+ {{ t('nextcloud-vue', 'Add section') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<!-- Layout options panel -->\n\t\t<div class=\"cn-links-form__options\">\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Columns') }}</span>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tmax=\"6\"\n\t\t\t\t\t:value=\"columns\"\n\t\t\t\t\tclass=\"cn-links-form__input cn-links-form__input--narrow\"\n\t\t\t\t\t@input=\"updateOption('columns', clampColumns($event.target.value))\">\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Layout') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"linkLayout\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('linkLayout', $event.target.value)\">\n\t\t\t\t\t<option value=\"card\">{{ t('nextcloud-vue', 'Card') }}</option>\n\t\t\t\t\t<option value=\"inline\">{{ t('nextcloud-vue', 'Inline') }}</option>\n\t\t\t\t\t<option value=\"icon-only\">{{ t('nextcloud-vue', 'Icon only') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Icon size') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"iconSize\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('iconSize', $event.target.value)\">\n\t\t\t\t\t<option value=\"small\">{{ t('nextcloud-vue', 'Small (24 px)') }}</option>\n\t\t\t\t\t<option value=\"medium\">{{ t('nextcloud-vue', 'Medium (40 px)') }}</option>\n\t\t\t\t\t<option value=\"large\">{{ t('nextcloud-vue', 'Large (64 px)') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"openInNewTab\"\n\t\t\t\t\t@change=\"updateOption('openInNewTab', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Open in new tab') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showSectionTitles\"\n\t\t\t\t\t@change=\"updateOption('showSectionTitles', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show section titles') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showLinkDescriptions\"\n\t\t\t\t\t:disabled=\"linkLayout !== 'card'\"\n\t\t\t\t\t@change=\"updateOption('showLinkDescriptions', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show descriptions') }}</span>\n\t\t\t</label>\n\t\t</div>\n\n\t\t<p v-if=\"firstError\" class=\"cn-links-form__error\">\n\t\t\t{{ firstError }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport CnIconBrowser from '../CnIconBrowser/CnIconBrowser.vue'\nimport { isPrototypeKey } from '../../utils/prototypeKeys.js'\n\nconst VALID_LAYOUTS = Object.freeze(['card', 'inline', 'icon-only'])\nconst VALID_SIZES = Object.freeze(['small', 'medium', 'large'])\n\nconst DEFAULT_CONTENT = Object.freeze({\n\tsections: [],\n\tcolumns: 3,\n\tlinkLayout: 'card',\n\ticonSize: 'medium',\n\topenInNewTab: true,\n\tshowSectionTitles: true,\n\tshowLinkDescriptions: true,\n})\n\n/**\n * Build an empty link row.\n *\n * @return {{label: string, url: string, icon: string, description: string}} the empty link.\n */\nfunction makeEmptyLink() {\n\treturn { label: '', url: '', icon: '', description: '' }\n}\n\n/**\n * Build an empty section with one link.\n *\n * @return {{title: string, links: object[]}} the empty section.\n */\nfunction makeEmptySection() {\n\treturn { title: '', links: [makeEmptyLink()] }\n}\n\n/**\n * URL sanitiser — accepts http(s) and root-relative URLs (without `..`).\n *\n * @param {string} url the candidate URL.\n * @return {string|null} an error message, or `null` when valid.\n */\nfunction validateUrl(url) {\n\tif (typeof url !== 'string' || url.trim() === '') {\n\t\treturn t('nextcloud-vue', 'Link URL is required')\n\t}\n\tconst trimmed = url.trim()\n\tif (trimmed.startsWith('/')) {\n\t\tif (trimmed.includes('..')) {\n\t\t\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n\t\t}\n\t\treturn null\n\t}\n\tif (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {\n\t\treturn null\n\t}\n\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n}\n\n/**\n * CnLinksWidgetForm — sub-form for creating or editing a `links` placement.\n *\n * Edits sections + links inline plus the global layout options (columns,\n * linkLayout, iconSize, openInNewTab, showSectionTitles, showLinkDescriptions).\n * `validate()` runs URL sanitisation and returns a non-empty error array when\n * any link URL is empty or unsafe. Uses up/down arrow buttons for reorder\n * (keyboard-accessible by default).\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnLinksWidgetForm',\n\n\tcomponents: {\n\t\tCnIconBrowser,\n\t},\n\n\tprops: {\n\t\t/** The placement being edited, or `null` in create mode. */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Initial content values (registry defaults when not editing). */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted on every change with the assembled content payload.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\treturn {\n\t\t\tsections: Array.isArray(initial.sections) && initial.sections.length > 0\n\t\t\t\t? this.cloneSections(initial.sections)\n\t\t\t\t: [],\n\n\t\t\tcolumns: this.clampColumns(initial.columns ?? DEFAULT_CONTENT.columns),\n\t\t\tlinkLayout: VALID_LAYOUTS.includes(initial.linkLayout)\n\t\t\t\t? initial.linkLayout\n\t\t\t\t: DEFAULT_CONTENT.linkLayout,\n\n\t\t\ticonSize: VALID_SIZES.includes(initial.iconSize)\n\t\t\t\t? initial.iconSize\n\t\t\t\t: DEFAULT_CONTENT.iconSize,\n\n\t\t\topenInNewTab: initial.openInNewTab === undefined ? DEFAULT_CONTENT.openInNewTab : Boolean(initial.openInNewTab),\n\t\t\tshowSectionTitles: initial.showSectionTitles === undefined ? DEFAULT_CONTENT.showSectionTitles : Boolean(initial.showSectionTitles),\n\t\t\tshowLinkDescriptions: initial.showLinkDescriptions === undefined ? DEFAULT_CONTENT.showLinkDescriptions : Boolean(initial.showLinkDescriptions),\n\t\t\tlinkErrors: [],\n\t\t\tfirstError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The assembled `content` payload emitted to the parent.\n\t\t *\n\t\t * @return {object} the content blob.\n\t\t */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tsections: this.cloneSections(this.sections),\n\t\t\t\tcolumns: this.columns,\n\t\t\t\tlinkLayout: this.linkLayout,\n\t\t\t\ticonSize: this.iconSize,\n\t\t\t\topenInNewTab: this.openInNewTab,\n\t\t\t\tshowSectionTitles: this.showSectionTitles,\n\t\t\t\tshowLinkDescriptions: this.showLinkDescriptions,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Deep-clone the sections into a normalised shape.\n\t\t *\n\t\t * @param {object[]} sections the sections to clone.\n\t\t * @return {Array<{title: string, links: object[]}>} the cloned sections.\n\t\t */\n\t\tcloneSections(sections) {\n\t\t\treturn sections.map((section) => ({\n\t\t\t\ttitle: typeof section?.title === 'string' ? section.title : '',\n\t\t\t\tlinks: Array.isArray(section?.links)\n\t\t\t\t\t? section.links.map((link) => ({\n\t\t\t\t\t\t\tlabel: typeof link?.label === 'string' ? link.label : '',\n\t\t\t\t\t\t\turl: typeof link?.url === 'string' ? link.url : '',\n\t\t\t\t\t\t\ticon: typeof link?.icon === 'string' ? link.icon : '',\n\t\t\t\t\t\t\tdescription: typeof link?.description === 'string' ? link.description : '',\n\t\t\t\t\t\t}))\n\t\t\t\t\t: [],\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Clamp the column count to 1–6.\n\t\t *\n\t\t * @param {unknown} value the candidate column count.\n\t\t * @return {number} the clamped column count.\n\t\t */\n\t\tclampColumns(value) {\n\t\t\tconst num = Number(value)\n\t\t\tif (!Number.isFinite(num)) {\n\t\t\t\treturn DEFAULT_CONTENT.columns\n\t\t\t}\n\t\t\treturn Math.max(1, Math.min(6, Math.round(num)))\n\t\t},\n\n\t\t/**\n\t\t * Emit `update:content` with the current assembled payload.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\temitUpdate() {\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Append a new section, then emit.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\taddSection() {\n\t\t\tthis.sections.push(makeEmptySection())\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Delete a section, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteSection(index) {\n\t\t\tthis.sections.splice(index, 1)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Move a section up or down, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveSection(index, delta) {\n\t\t\tconst target = index + delta\n\t\t\tif (target < 0 || target >= this.sections.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = this.sections.splice(index, 1)\n\t\t\tthis.sections.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a section title, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {string} title the new title.\n\t\t * @return {void}\n\t\t */\n\t\tupdateSectionTitle(index, title) {\n\t\t\tif (this.sections[index]) {\n\t\t\t\tthis.sections[index].title = title\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Append a link to a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @return {void}\n\t\t */\n\t\taddLink(sectionIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section) {\n\t\t\t\tsection.links.push(makeEmptyLink())\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a link from a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteLink(sectionIndex, linkIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section && section.links[linkIndex] !== undefined) {\n\t\t\t\tsection.links.splice(linkIndex, 1)\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Move a link up or down within its section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveLink(sectionIndex, linkIndex, delta) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst target = linkIndex + delta\n\t\t\tif (target < 0 || target >= section.links.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = section.links.splice(linkIndex, 1)\n\t\t\tsection.links.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update one field of one link, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {string} field the link field.\n\t\t * @param {string} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateLink(sectionIndex, linkIndex, field, value) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst link = section.links[linkIndex]\n\t\t\tif (!link || isPrototypeKey(field)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlink[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a global layout option, then emit.\n\t\t *\n\t\t * @param {string} field the option field.\n\t\t * @param {unknown} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateOption(field, value) {\n\t\t\tif (field === 'linkLayout' && !VALID_LAYOUTS.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (field === 'iconSize' && !VALID_SIZES.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Validate every link URL across every section. Empty sections are\n\t\t * skipped (the renderer hides them anyway).\n\t\t *\n\t\t * @return {string[]} the validation errors (empty when valid).\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = []\n\t\t\tconst linkErrors = []\n\t\t\tthis.sections.forEach((section, sIdx) => {\n\t\t\t\tconst sectionErrors = []\n\t\t\t\tif (!Array.isArray(section.links)) {\n\t\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tsection.links.forEach((link, lIdx) => {\n\t\t\t\t\tif (typeof link.label !== 'string' || link.label.trim() === '') {\n\t\t\t\t\t\tconst msg = t('nextcloud-vue', 'Link label is required')\n\t\t\t\t\t\tsectionErrors[lIdx] = msg\n\t\t\t\t\t\terrors.push(msg)\n\t\t\t\t\t}\n\t\t\t\t\tconst urlError = validateUrl(link.url)\n\t\t\t\t\tif (urlError) {\n\t\t\t\t\t\tsectionErrors[lIdx] = urlError\n\t\t\t\t\t\terrors.push(urlError)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t})\n\t\t\tthis.linkErrors = linkErrors\n\t\t\tthis.firstError = errors.length > 0 ? errors[0] : ''\n\t\t\treturn errors\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-links-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n\n.cn-links-form__sections {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-links-form__section {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tpadding: 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius, 4px);\n\tbackground-color: var(--color-background-hover);\n}\n\n.cn-links-form__section-header {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: center;\n}\n\n.cn-links-form__section-title {\n\tflex: 1;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-links-form__section-actions {\n\tdisplay: flex;\n\tgap: 4px;\n}\n\n.cn-links-form__links {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding-left: 8px;\n}\n\n.cn-links-form__link-row {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n\tflex-wrap: wrap;\n}\n\n.cn-links-form__input {\n\tflex: 1;\n\tmin-width: 80px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-size: 13px;\n}\n\n.cn-links-form__link-row--invalid .cn-links-form__input {\n\tborder-color: var(--color-error);\n}\n\n.cn-links-form__input--narrow {\n\tflex: 0 0 auto;\n\twidth: 110px;\n}\n\n.cn-links-form__btn {\n\tpadding: 4px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n\tfont-size: 13px;\n}\n\n.cn-links-form__btn--small {\n\tpadding: 2px 6px;\n\tfont-size: 12px;\n}\n\n.cn-links-form__btn--ghost {\n\tborder-style: dashed;\n\tbackground-color: transparent;\n\talign-self: flex-start;\n}\n\n.cn-links-form__btn--danger {\n\tborder-color: var(--color-error);\n\tcolor: var(--color-error);\n}\n\n.cn-links-form__btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n.cn-links-form__options {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\tgap: 12px;\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-links-form__option {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 13px;\n}\n\n.cn-links-form__option--checkbox {\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n}\n\n.cn-links-form__error {\n\tmargin: 0;\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n}\n</style>\n"],"names":["t","CnIconBrowser"],"mappings":";;;;AA+LA,MAAM,aAAc,GAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAA;AACnE,MAAM,WAAU,GAAI,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,QAAQ,EAA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MAAM,CAAC,CAAC,CAAA,GAAI,GAAC;GACnD,OAAO,MAAK;GACZ;EACD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnLinksWidgetForm.vue3.js","sources":["../../../../src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue?vue&type=template&id=20b5fafa&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-links-form\">\n\t\t<!-- Sections editor -->\n\t\t<div class=\"cn-links-form__sections\">\n\t\t\t<div\n\t\t\t\tv-for=\"(section, sIdx) in sections\"\n\t\t\t\t:key=\"sIdx\"\n\t\t\t\tclass=\"cn-links-form__section\">\n\t\t\t\t<div class=\"cn-links-form__section-header\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cn-links-form__section-title\"\n\t\t\t\t\t\t:value=\"section.title\"\n\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Section title')\"\n\t\t\t\t\t\t@input=\"updateSectionTitle(sIdx, $event.target.value)\">\n\t\t\t\t\t<div class=\"cn-links-form__section-actions\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === sections.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete section')\"\n\t\t\t\t\t\t\t@click=\"deleteSection(sIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"cn-links-form__links\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(link, lIdx) in section.links\"\n\t\t\t\t\t\t:key=\"lIdx\"\n\t\t\t\t\t\tclass=\"cn-links-form__link-row\"\n\t\t\t\t\t\t:class=\"{ 'cn-links-form__link-row--invalid': linkErrors[sIdx] && linkErrors[sIdx][lIdx] }\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.label\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Label')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'label', $event.target.value)\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.url\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'URL')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'url', $event.target.value)\">\n\t\t\t\t\t\t<CnIconBrowser\n\t\t\t\t\t\t\tclass=\"cn-links-form__icon\"\n\t\t\t\t\t\t\t:value=\"link.icon\"\n\t\t\t\t\t\t\tallowUrl\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'icon', $event)\" />\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tv-if=\"showLinkDescriptions\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.description\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Description (optional)')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'description', $event.target.value)\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === section.links.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete link')\"\n\t\t\t\t\t\t\t@click=\"deleteLink(sIdx, lIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t\t\t@click=\"addLink(sIdx)\">\n\t\t\t\t\t\t+ {{ t('nextcloud-vue', 'Add link') }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t@click=\"addSection\">\n\t\t\t\t+ {{ t('nextcloud-vue', 'Add section') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<!-- Layout options panel -->\n\t\t<div class=\"cn-links-form__options\">\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Columns') }}</span>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tmax=\"6\"\n\t\t\t\t\t:value=\"columns\"\n\t\t\t\t\tclass=\"cn-links-form__input cn-links-form__input--narrow\"\n\t\t\t\t\t@input=\"updateOption('columns', clampColumns($event.target.value))\">\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Layout') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"linkLayout\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('linkLayout', $event.target.value)\">\n\t\t\t\t\t<option value=\"card\">{{ t('nextcloud-vue', 'Card') }}</option>\n\t\t\t\t\t<option value=\"inline\">{{ t('nextcloud-vue', 'Inline') }}</option>\n\t\t\t\t\t<option value=\"icon-only\">{{ t('nextcloud-vue', 'Icon only') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Icon size') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"iconSize\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('iconSize', $event.target.value)\">\n\t\t\t\t\t<option value=\"small\">{{ t('nextcloud-vue', 'Small (24 px)') }}</option>\n\t\t\t\t\t<option value=\"medium\">{{ t('nextcloud-vue', 'Medium (40 px)') }}</option>\n\t\t\t\t\t<option value=\"large\">{{ t('nextcloud-vue', 'Large (64 px)') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"openInNewTab\"\n\t\t\t\t\t@change=\"updateOption('openInNewTab', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Open in new tab') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showSectionTitles\"\n\t\t\t\t\t@change=\"updateOption('showSectionTitles', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show section titles') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showLinkDescriptions\"\n\t\t\t\t\t:disabled=\"linkLayout !== 'card'\"\n\t\t\t\t\t@change=\"updateOption('showLinkDescriptions', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show descriptions') }}</span>\n\t\t\t</label>\n\t\t</div>\n\n\t\t<p v-if=\"firstError\" class=\"cn-links-form__error\">\n\t\t\t{{ firstError }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport CnIconBrowser from '../CnIconBrowser/CnIconBrowser.vue'\n\nconst VALID_LAYOUTS = Object.freeze(['card', 'inline', 'icon-only'])\nconst VALID_SIZES = Object.freeze(['small', 'medium', 'large'])\n\nconst DEFAULT_CONTENT = Object.freeze({\n\tsections: [],\n\tcolumns: 3,\n\tlinkLayout: 'card',\n\ticonSize: 'medium',\n\topenInNewTab: true,\n\tshowSectionTitles: true,\n\tshowLinkDescriptions: true,\n})\n\n/**\n * Build an empty link row.\n *\n * @return {{label: string, url: string, icon: string, description: string}} the empty link.\n */\nfunction makeEmptyLink() {\n\treturn { label: '', url: '', icon: '', description: '' }\n}\n\n/**\n * Build an empty section with one link.\n *\n * @return {{title: string, links: object[]}} the empty section.\n */\nfunction makeEmptySection() {\n\treturn { title: '', links: [makeEmptyLink()] }\n}\n\n/**\n * URL sanitiser — accepts http(s) and root-relative URLs (without `..`).\n *\n * @param {string} url the candidate URL.\n * @return {string|null} an error message, or `null` when valid.\n */\nfunction validateUrl(url) {\n\tif (typeof url !== 'string' || url.trim() === '') {\n\t\treturn t('nextcloud-vue', 'Link URL is required')\n\t}\n\tconst trimmed = url.trim()\n\tif (trimmed.startsWith('/')) {\n\t\tif (trimmed.includes('..')) {\n\t\t\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n\t\t}\n\t\treturn null\n\t}\n\tif (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {\n\t\treturn null\n\t}\n\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n}\n\n/**\n * CnLinksWidgetForm — sub-form for creating or editing a `links` placement.\n *\n * Edits sections + links inline plus the global layout options (columns,\n * linkLayout, iconSize, openInNewTab, showSectionTitles, showLinkDescriptions).\n * `validate()` runs URL sanitisation and returns a non-empty error array when\n * any link URL is empty or unsafe. Uses up/down arrow buttons for reorder\n * (keyboard-accessible by default).\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnLinksWidgetForm',\n\n\tcomponents: {\n\t\tCnIconBrowser,\n\t},\n\n\tprops: {\n\t\t/** The placement being edited, or `null` in create mode. */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Initial content values (registry defaults when not editing). */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted on every change with the assembled content payload.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\treturn {\n\t\t\tsections: Array.isArray(initial.sections) && initial.sections.length > 0\n\t\t\t\t? this.cloneSections(initial.sections)\n\t\t\t\t: [],\n\n\t\t\tcolumns: this.clampColumns(initial.columns ?? DEFAULT_CONTENT.columns),\n\t\t\tlinkLayout: VALID_LAYOUTS.includes(initial.linkLayout)\n\t\t\t\t? initial.linkLayout\n\t\t\t\t: DEFAULT_CONTENT.linkLayout,\n\n\t\t\ticonSize: VALID_SIZES.includes(initial.iconSize)\n\t\t\t\t? initial.iconSize\n\t\t\t\t: DEFAULT_CONTENT.iconSize,\n\n\t\t\topenInNewTab: initial.openInNewTab === undefined ? DEFAULT_CONTENT.openInNewTab : Boolean(initial.openInNewTab),\n\t\t\tshowSectionTitles: initial.showSectionTitles === undefined ? DEFAULT_CONTENT.showSectionTitles : Boolean(initial.showSectionTitles),\n\t\t\tshowLinkDescriptions: initial.showLinkDescriptions === undefined ? DEFAULT_CONTENT.showLinkDescriptions : Boolean(initial.showLinkDescriptions),\n\t\t\tlinkErrors: [],\n\t\t\tfirstError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The assembled `content` payload emitted to the parent.\n\t\t *\n\t\t * @return {object} the content blob.\n\t\t */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tsections: this.cloneSections(this.sections),\n\t\t\t\tcolumns: this.columns,\n\t\t\t\tlinkLayout: this.linkLayout,\n\t\t\t\ticonSize: this.iconSize,\n\t\t\t\topenInNewTab: this.openInNewTab,\n\t\t\t\tshowSectionTitles: this.showSectionTitles,\n\t\t\t\tshowLinkDescriptions: this.showLinkDescriptions,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Deep-clone the sections into a normalised shape.\n\t\t *\n\t\t * @param {object[]} sections the sections to clone.\n\t\t * @return {Array<{title: string, links: object[]}>} the cloned sections.\n\t\t */\n\t\tcloneSections(sections) {\n\t\t\treturn sections.map((section) => ({\n\t\t\t\ttitle: typeof section?.title === 'string' ? section.title : '',\n\t\t\t\tlinks: Array.isArray(section?.links)\n\t\t\t\t\t? section.links.map((link) => ({\n\t\t\t\t\t\t\tlabel: typeof link?.label === 'string' ? link.label : '',\n\t\t\t\t\t\t\turl: typeof link?.url === 'string' ? link.url : '',\n\t\t\t\t\t\t\ticon: typeof link?.icon === 'string' ? link.icon : '',\n\t\t\t\t\t\t\tdescription: typeof link?.description === 'string' ? link.description : '',\n\t\t\t\t\t\t}))\n\t\t\t\t\t: [],\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Clamp the column count to 1–6.\n\t\t *\n\t\t * @param {unknown} value the candidate column count.\n\t\t * @return {number} the clamped column count.\n\t\t */\n\t\tclampColumns(value) {\n\t\t\tconst num = Number(value)\n\t\t\tif (!Number.isFinite(num)) {\n\t\t\t\treturn DEFAULT_CONTENT.columns\n\t\t\t}\n\t\t\treturn Math.max(1, Math.min(6, Math.round(num)))\n\t\t},\n\n\t\t/**\n\t\t * Emit `update:content` with the current assembled payload.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\temitUpdate() {\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Append a new section, then emit.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\taddSection() {\n\t\t\tthis.sections.push(makeEmptySection())\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Delete a section, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteSection(index) {\n\t\t\tthis.sections.splice(index, 1)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Move a section up or down, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveSection(index, delta) {\n\t\t\tconst target = index + delta\n\t\t\tif (target < 0 || target >= this.sections.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = this.sections.splice(index, 1)\n\t\t\tthis.sections.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a section title, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {string} title the new title.\n\t\t * @return {void}\n\t\t */\n\t\tupdateSectionTitle(index, title) {\n\t\t\tif (this.sections[index]) {\n\t\t\t\tthis.sections[index].title = title\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Append a link to a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @return {void}\n\t\t */\n\t\taddLink(sectionIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section) {\n\t\t\t\tsection.links.push(makeEmptyLink())\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a link from a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteLink(sectionIndex, linkIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section && section.links[linkIndex] !== undefined) {\n\t\t\t\tsection.links.splice(linkIndex, 1)\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Move a link up or down within its section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveLink(sectionIndex, linkIndex, delta) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst target = linkIndex + delta\n\t\t\tif (target < 0 || target >= section.links.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = section.links.splice(linkIndex, 1)\n\t\t\tsection.links.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update one field of one link, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {string} field the link field.\n\t\t * @param {string} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateLink(sectionIndex, linkIndex, field, value) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst link = section.links[linkIndex]\n\t\t\tif (!link) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlink[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a global layout option, then emit.\n\t\t *\n\t\t * @param {string} field the option field.\n\t\t * @param {unknown} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateOption(field, value) {\n\t\t\tif (field === 'linkLayout' && !VALID_LAYOUTS.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (field === 'iconSize' && !VALID_SIZES.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Validate every link URL across every section. Empty sections are\n\t\t * skipped (the renderer hides them anyway).\n\t\t *\n\t\t * @return {string[]} the validation errors (empty when valid).\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = []\n\t\t\tconst linkErrors = []\n\t\t\tthis.sections.forEach((section, sIdx) => {\n\t\t\t\tconst sectionErrors = []\n\t\t\t\tif (!Array.isArray(section.links)) {\n\t\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tsection.links.forEach((link, lIdx) => {\n\t\t\t\t\tif (typeof link.label !== 'string' || link.label.trim() === '') {\n\t\t\t\t\t\tconst msg = t('nextcloud-vue', 'Link label is required')\n\t\t\t\t\t\tsectionErrors[lIdx] = msg\n\t\t\t\t\t\terrors.push(msg)\n\t\t\t\t\t}\n\t\t\t\t\tconst urlError = validateUrl(link.url)\n\t\t\t\t\tif (urlError) {\n\t\t\t\t\t\tsectionErrors[lIdx] = urlError\n\t\t\t\t\t\terrors.push(urlError)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t})\n\t\t\tthis.linkErrors = linkErrors\n\t\t\tthis.firstError = errors.length > 0 ? errors[0] : ''\n\t\t\treturn errors\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-links-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n\n.cn-links-form__sections {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-links-form__section {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tpadding: 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius, 4px);\n\tbackground-color: var(--color-background-hover);\n}\n\n.cn-links-form__section-header {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: center;\n}\n\n.cn-links-form__section-title {\n\tflex: 1;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-links-form__section-actions {\n\tdisplay: flex;\n\tgap: 4px;\n}\n\n.cn-links-form__links {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding-left: 8px;\n}\n\n.cn-links-form__link-row {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n\tflex-wrap: wrap;\n}\n\n.cn-links-form__input {\n\tflex: 1;\n\tmin-width: 80px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-size: 13px;\n}\n\n.cn-links-form__link-row--invalid .cn-links-form__input {\n\tborder-color: var(--color-error);\n}\n\n.cn-links-form__input--narrow {\n\tflex: 0 0 auto;\n\twidth: 110px;\n}\n\n.cn-links-form__btn {\n\tpadding: 4px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n\tfont-size: 13px;\n}\n\n.cn-links-form__btn--small {\n\tpadding: 2px 6px;\n\tfont-size: 12px;\n}\n\n.cn-links-form__btn--ghost {\n\tborder-style: dashed;\n\tbackground-color: transparent;\n\talign-self: flex-start;\n}\n\n.cn-links-form__btn--danger {\n\tborder-color: var(--color-error);\n\tcolor: var(--color-error);\n}\n\n.cn-links-form__btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n.cn-links-form__options {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\tgap: 12px;\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-links-form__option {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 13px;\n}\n\n.cn-links-form__option--checkbox {\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n}\n\n.cn-links-form__error {\n\tmargin: 0;\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n}\n</style>\n"],"names":["_createElementVNode","_Fragment","_renderList","_normalizeClass","_createVNode","_toDisplayString"],"mappings":";;AAWM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,eAAE,GAAA;AAEP,MAAA,UAAA,GAAA,E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A;AACrB,UAAA,QAAG,uCAAA,QAAA,CAAA,YAAA,CAAA,cAAA,EAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;AACJ,QAAAA,kBAAA,CAAc,8BAAN,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,iBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;yBASH,oBAAA,EAAA;QALPA,kBAGK,CAAA,OAAA,EAAA;;AADH,UAAA,OAAO,EAAE,KAAiB,CAAA,iBAAA;AAC1B,UAAA,QAAG,uCAAA,QAAA,CAAA,YAAA,CAAA,mBAAA,EAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;AACJ,QAAAA,kBAAA,CAAc,8BAAN,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,qBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;AAGT,MAAAA,kBAAA,CAOA,SAPA,WAOA,EAAA;QANDA,kBAI+C,CAAA,OAAA,EAAA;AAH9C,UAAA,IAAI,EAAC,UAAA;AACJ,UAAA,OAAC,EAAA,KAAA,CAAA,oBAAA;;AAED,UAAA,QAAM,uCAAE,QAAY,CAAA,YAAA,CAAA,sBAAA,EAAyB,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;AAC/C,QAAAA,kBAAA,CAAc,8BAAL,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,mBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnLinksWidgetForm.vue3.js","sources":["../../../../src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue?vue&type=template&id=30ca960f&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-links-form\">\n\t\t<!-- Sections editor -->\n\t\t<div class=\"cn-links-form__sections\">\n\t\t\t<div\n\t\t\t\tv-for=\"(section, sIdx) in sections\"\n\t\t\t\t:key=\"sIdx\"\n\t\t\t\tclass=\"cn-links-form__section\">\n\t\t\t\t<div class=\"cn-links-form__section-header\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cn-links-form__section-title\"\n\t\t\t\t\t\t:value=\"section.title\"\n\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Section title')\"\n\t\t\t\t\t\t@input=\"updateSectionTitle(sIdx, $event.target.value)\">\n\t\t\t\t\t<div class=\"cn-links-form__section-actions\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"sIdx === sections.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveSection(sIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete section')\"\n\t\t\t\t\t\t\t@click=\"deleteSection(sIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"cn-links-form__links\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(link, lIdx) in section.links\"\n\t\t\t\t\t\t:key=\"lIdx\"\n\t\t\t\t\t\tclass=\"cn-links-form__link-row\"\n\t\t\t\t\t\t:class=\"{ 'cn-links-form__link-row--invalid': linkErrors[sIdx] && linkErrors[sIdx][lIdx] }\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.label\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Label')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'label', $event.target.value)\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.url\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'URL')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'url', $event.target.value)\">\n\t\t\t\t\t\t<CnIconBrowser\n\t\t\t\t\t\t\tclass=\"cn-links-form__icon\"\n\t\t\t\t\t\t\t:value=\"link.icon\"\n\t\t\t\t\t\t\tallowUrl\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'icon', $event)\" />\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tv-if=\"showLinkDescriptions\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t\t\t:value=\"link.description\"\n\t\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Description (optional)')\"\n\t\t\t\t\t\t\t@input=\"updateLink(sIdx, lIdx, 'description', $event.target.value)\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === 0\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move up')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, -1)\">\n\t\t\t\t\t\t\t↑\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--small\"\n\t\t\t\t\t\t\t:disabled=\"lIdx === section.links.length - 1\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Move down')\"\n\t\t\t\t\t\t\t@click=\"moveLink(sIdx, lIdx, 1)\">\n\t\t\t\t\t\t\t↓\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--danger\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Delete link')\"\n\t\t\t\t\t\t\t@click=\"deleteLink(sIdx, lIdx)\">\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t\t\t@click=\"addLink(sIdx)\">\n\t\t\t\t\t\t+ {{ t('nextcloud-vue', 'Add link') }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-links-form__btn cn-links-form__btn--ghost\"\n\t\t\t\t@click=\"addSection\">\n\t\t\t\t+ {{ t('nextcloud-vue', 'Add section') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<!-- Layout options panel -->\n\t\t<div class=\"cn-links-form__options\">\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Columns') }}</span>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tmin=\"1\"\n\t\t\t\t\tmax=\"6\"\n\t\t\t\t\t:value=\"columns\"\n\t\t\t\t\tclass=\"cn-links-form__input cn-links-form__input--narrow\"\n\t\t\t\t\t@input=\"updateOption('columns', clampColumns($event.target.value))\">\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Layout') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"linkLayout\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('linkLayout', $event.target.value)\">\n\t\t\t\t\t<option value=\"card\">{{ t('nextcloud-vue', 'Card') }}</option>\n\t\t\t\t\t<option value=\"inline\">{{ t('nextcloud-vue', 'Inline') }}</option>\n\t\t\t\t\t<option value=\"icon-only\">{{ t('nextcloud-vue', 'Icon only') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Icon size') }}</span>\n\t\t\t\t<select\n\t\t\t\t\t:value=\"iconSize\"\n\t\t\t\t\tclass=\"cn-links-form__input\"\n\t\t\t\t\t@change=\"updateOption('iconSize', $event.target.value)\">\n\t\t\t\t\t<option value=\"small\">{{ t('nextcloud-vue', 'Small (24 px)') }}</option>\n\t\t\t\t\t<option value=\"medium\">{{ t('nextcloud-vue', 'Medium (40 px)') }}</option>\n\t\t\t\t\t<option value=\"large\">{{ t('nextcloud-vue', 'Large (64 px)') }}</option>\n\t\t\t\t</select>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"openInNewTab\"\n\t\t\t\t\t@change=\"updateOption('openInNewTab', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Open in new tab') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showSectionTitles\"\n\t\t\t\t\t@change=\"updateOption('showSectionTitles', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show section titles') }}</span>\n\t\t\t</label>\n\n\t\t\t<label class=\"cn-links-form__option cn-links-form__option--checkbox\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t:checked=\"showLinkDescriptions\"\n\t\t\t\t\t:disabled=\"linkLayout !== 'card'\"\n\t\t\t\t\t@change=\"updateOption('showLinkDescriptions', $event.target.checked)\">\n\t\t\t\t<span>{{ t('nextcloud-vue', 'Show descriptions') }}</span>\n\t\t\t</label>\n\t\t</div>\n\n\t\t<p v-if=\"firstError\" class=\"cn-links-form__error\">\n\t\t\t{{ firstError }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport CnIconBrowser from '../CnIconBrowser/CnIconBrowser.vue'\nimport { isPrototypeKey } from '../../utils/prototypeKeys.js'\n\nconst VALID_LAYOUTS = Object.freeze(['card', 'inline', 'icon-only'])\nconst VALID_SIZES = Object.freeze(['small', 'medium', 'large'])\n\nconst DEFAULT_CONTENT = Object.freeze({\n\tsections: [],\n\tcolumns: 3,\n\tlinkLayout: 'card',\n\ticonSize: 'medium',\n\topenInNewTab: true,\n\tshowSectionTitles: true,\n\tshowLinkDescriptions: true,\n})\n\n/**\n * Build an empty link row.\n *\n * @return {{label: string, url: string, icon: string, description: string}} the empty link.\n */\nfunction makeEmptyLink() {\n\treturn { label: '', url: '', icon: '', description: '' }\n}\n\n/**\n * Build an empty section with one link.\n *\n * @return {{title: string, links: object[]}} the empty section.\n */\nfunction makeEmptySection() {\n\treturn { title: '', links: [makeEmptyLink()] }\n}\n\n/**\n * URL sanitiser — accepts http(s) and root-relative URLs (without `..`).\n *\n * @param {string} url the candidate URL.\n * @return {string|null} an error message, or `null` when valid.\n */\nfunction validateUrl(url) {\n\tif (typeof url !== 'string' || url.trim() === '') {\n\t\treturn t('nextcloud-vue', 'Link URL is required')\n\t}\n\tconst trimmed = url.trim()\n\tif (trimmed.startsWith('/')) {\n\t\tif (trimmed.includes('..')) {\n\t\t\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n\t\t}\n\t\treturn null\n\t}\n\tif (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {\n\t\treturn null\n\t}\n\treturn t('nextcloud-vue', 'Invalid URL — use HTTP(S) or relative paths.')\n}\n\n/**\n * CnLinksWidgetForm — sub-form for creating or editing a `links` placement.\n *\n * Edits sections + links inline plus the global layout options (columns,\n * linkLayout, iconSize, openInNewTab, showSectionTitles, showLinkDescriptions).\n * `validate()` runs URL sanitisation and returns a non-empty error array when\n * any link URL is empty or unsafe. Uses up/down arrow buttons for reorder\n * (keyboard-accessible by default).\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnLinksWidgetForm',\n\n\tcomponents: {\n\t\tCnIconBrowser,\n\t},\n\n\tprops: {\n\t\t/** The placement being edited, or `null` in create mode. */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Initial content values (registry defaults when not editing). */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted on every change with the assembled content payload.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\treturn {\n\t\t\tsections: Array.isArray(initial.sections) && initial.sections.length > 0\n\t\t\t\t? this.cloneSections(initial.sections)\n\t\t\t\t: [],\n\n\t\t\tcolumns: this.clampColumns(initial.columns ?? DEFAULT_CONTENT.columns),\n\t\t\tlinkLayout: VALID_LAYOUTS.includes(initial.linkLayout)\n\t\t\t\t? initial.linkLayout\n\t\t\t\t: DEFAULT_CONTENT.linkLayout,\n\n\t\t\ticonSize: VALID_SIZES.includes(initial.iconSize)\n\t\t\t\t? initial.iconSize\n\t\t\t\t: DEFAULT_CONTENT.iconSize,\n\n\t\t\topenInNewTab: initial.openInNewTab === undefined ? DEFAULT_CONTENT.openInNewTab : Boolean(initial.openInNewTab),\n\t\t\tshowSectionTitles: initial.showSectionTitles === undefined ? DEFAULT_CONTENT.showSectionTitles : Boolean(initial.showSectionTitles),\n\t\t\tshowLinkDescriptions: initial.showLinkDescriptions === undefined ? DEFAULT_CONTENT.showLinkDescriptions : Boolean(initial.showLinkDescriptions),\n\t\t\tlinkErrors: [],\n\t\t\tfirstError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The assembled `content` payload emitted to the parent.\n\t\t *\n\t\t * @return {object} the content blob.\n\t\t */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tsections: this.cloneSections(this.sections),\n\t\t\t\tcolumns: this.columns,\n\t\t\t\tlinkLayout: this.linkLayout,\n\t\t\t\ticonSize: this.iconSize,\n\t\t\t\topenInNewTab: this.openInNewTab,\n\t\t\t\tshowSectionTitles: this.showSectionTitles,\n\t\t\t\tshowLinkDescriptions: this.showLinkDescriptions,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Deep-clone the sections into a normalised shape.\n\t\t *\n\t\t * @param {object[]} sections the sections to clone.\n\t\t * @return {Array<{title: string, links: object[]}>} the cloned sections.\n\t\t */\n\t\tcloneSections(sections) {\n\t\t\treturn sections.map((section) => ({\n\t\t\t\ttitle: typeof section?.title === 'string' ? section.title : '',\n\t\t\t\tlinks: Array.isArray(section?.links)\n\t\t\t\t\t? section.links.map((link) => ({\n\t\t\t\t\t\t\tlabel: typeof link?.label === 'string' ? link.label : '',\n\t\t\t\t\t\t\turl: typeof link?.url === 'string' ? link.url : '',\n\t\t\t\t\t\t\ticon: typeof link?.icon === 'string' ? link.icon : '',\n\t\t\t\t\t\t\tdescription: typeof link?.description === 'string' ? link.description : '',\n\t\t\t\t\t\t}))\n\t\t\t\t\t: [],\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Clamp the column count to 1–6.\n\t\t *\n\t\t * @param {unknown} value the candidate column count.\n\t\t * @return {number} the clamped column count.\n\t\t */\n\t\tclampColumns(value) {\n\t\t\tconst num = Number(value)\n\t\t\tif (!Number.isFinite(num)) {\n\t\t\t\treturn DEFAULT_CONTENT.columns\n\t\t\t}\n\t\t\treturn Math.max(1, Math.min(6, Math.round(num)))\n\t\t},\n\n\t\t/**\n\t\t * Emit `update:content` with the current assembled payload.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\temitUpdate() {\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Append a new section, then emit.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\taddSection() {\n\t\t\tthis.sections.push(makeEmptySection())\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Delete a section, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteSection(index) {\n\t\t\tthis.sections.splice(index, 1)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Move a section up or down, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveSection(index, delta) {\n\t\t\tconst target = index + delta\n\t\t\tif (target < 0 || target >= this.sections.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = this.sections.splice(index, 1)\n\t\t\tthis.sections.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a section title, then emit.\n\t\t *\n\t\t * @param {number} index the section index.\n\t\t * @param {string} title the new title.\n\t\t * @return {void}\n\t\t */\n\t\tupdateSectionTitle(index, title) {\n\t\t\tif (this.sections[index]) {\n\t\t\t\tthis.sections[index].title = title\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Append a link to a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @return {void}\n\t\t */\n\t\taddLink(sectionIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section) {\n\t\t\t\tsection.links.push(makeEmptyLink())\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a link from a section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @return {void}\n\t\t */\n\t\tdeleteLink(sectionIndex, linkIndex) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (section && section.links[linkIndex] !== undefined) {\n\t\t\t\tsection.links.splice(linkIndex, 1)\n\t\t\t\tthis.emitUpdate()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Move a link up or down within its section, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {number} delta `-1` or `+1`.\n\t\t * @return {void}\n\t\t */\n\t\tmoveLink(sectionIndex, linkIndex, delta) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst target = linkIndex + delta\n\t\t\tif (target < 0 || target >= section.links.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst [removed] = section.links.splice(linkIndex, 1)\n\t\t\tsection.links.splice(target, 0, removed)\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update one field of one link, then emit.\n\t\t *\n\t\t * @param {number} sectionIndex the section index.\n\t\t * @param {number} linkIndex the link index.\n\t\t * @param {string} field the link field.\n\t\t * @param {string} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateLink(sectionIndex, linkIndex, field, value) {\n\t\t\tconst section = this.sections[sectionIndex]\n\t\t\tif (!section) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst link = section.links[linkIndex]\n\t\t\tif (!link || isPrototypeKey(field)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlink[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Update a global layout option, then emit.\n\t\t *\n\t\t * @param {string} field the option field.\n\t\t * @param {unknown} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateOption(field, value) {\n\t\t\tif (field === 'linkLayout' && !VALID_LAYOUTS.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (field === 'iconSize' && !VALID_SIZES.includes(value)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis[field] = value\n\t\t\tthis.emitUpdate()\n\t\t},\n\n\t\t/**\n\t\t * Validate every link URL across every section. Empty sections are\n\t\t * skipped (the renderer hides them anyway).\n\t\t *\n\t\t * @return {string[]} the validation errors (empty when valid).\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = []\n\t\t\tconst linkErrors = []\n\t\t\tthis.sections.forEach((section, sIdx) => {\n\t\t\t\tconst sectionErrors = []\n\t\t\t\tif (!Array.isArray(section.links)) {\n\t\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tsection.links.forEach((link, lIdx) => {\n\t\t\t\t\tif (typeof link.label !== 'string' || link.label.trim() === '') {\n\t\t\t\t\t\tconst msg = t('nextcloud-vue', 'Link label is required')\n\t\t\t\t\t\tsectionErrors[lIdx] = msg\n\t\t\t\t\t\terrors.push(msg)\n\t\t\t\t\t}\n\t\t\t\t\tconst urlError = validateUrl(link.url)\n\t\t\t\t\tif (urlError) {\n\t\t\t\t\t\tsectionErrors[lIdx] = urlError\n\t\t\t\t\t\terrors.push(urlError)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tlinkErrors[sIdx] = sectionErrors\n\t\t\t})\n\t\t\tthis.linkErrors = linkErrors\n\t\t\tthis.firstError = errors.length > 0 ? errors[0] : ''\n\t\t\treturn errors\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-links-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n\n.cn-links-form__sections {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-links-form__section {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tpadding: 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius, 4px);\n\tbackground-color: var(--color-background-hover);\n}\n\n.cn-links-form__section-header {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: center;\n}\n\n.cn-links-form__section-title {\n\tflex: 1;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-links-form__section-actions {\n\tdisplay: flex;\n\tgap: 4px;\n}\n\n.cn-links-form__links {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding-left: 8px;\n}\n\n.cn-links-form__link-row {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n\tflex-wrap: wrap;\n}\n\n.cn-links-form__input {\n\tflex: 1;\n\tmin-width: 80px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-size: 13px;\n}\n\n.cn-links-form__link-row--invalid .cn-links-form__input {\n\tborder-color: var(--color-error);\n}\n\n.cn-links-form__input--narrow {\n\tflex: 0 0 auto;\n\twidth: 110px;\n}\n\n.cn-links-form__btn {\n\tpadding: 4px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n\tfont-size: 13px;\n}\n\n.cn-links-form__btn--small {\n\tpadding: 2px 6px;\n\tfont-size: 12px;\n}\n\n.cn-links-form__btn--ghost {\n\tborder-style: dashed;\n\tbackground-color: transparent;\n\talign-self: flex-start;\n}\n\n.cn-links-form__btn--danger {\n\tborder-color: var(--color-error);\n\tcolor: var(--color-error);\n}\n\n.cn-links-form__btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n.cn-links-form__options {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\tgap: 12px;\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-links-form__option {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 13px;\n}\n\n.cn-links-form__option--checkbox {\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n}\n\n.cn-links-form__error {\n\tmargin: 0;\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n}\n</style>\n"],"names":["_createElementVNode","_Fragment","_renderList","_normalizeClass","_createVNode","_toDisplayString"],"mappings":";;AAWM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,eAAE,GAAA;AAEP,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAyB,GAAA;AAK7B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAA+B,GAAA;;AAOpC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gCAA4B,GAAA;;;;AA2BnC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAE,sBAAqB,GAAA;;;;;;;;AAuE9B,MAAA,WAAA,GAAA,EAAA,KAAI,EAAA,wBAAA,GAAA;AACD,MAAA,WAAA,GAAA,EAAA,KAAC,EAAA,uBAAA,GAAA;;AAWD,MAAA,WAAA,GAA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,YAAA,CAAA,mBAAA,EAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;AACJ,QAAAA,kBAAA,CAAc,8BAAN,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,qBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;AAGT,MAAAA,kBAAA,CAOA,SAPA,WAOA,EAAA;QANDA,kBAI+C,CAAA,OAAA,EAAA;AAH9C,UAAA,IAAI,EAAC,UAAA;AACJ,UAAA,OAAC,EAAA,KAAA,CAAA,oBAAA;;AAED,UAAA,QAAM,uCAAE,QAAY,CAAA,YAAA,CAAA,sBAAA,EAAyB,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;AAC/C,QAAAA,kBAAA,CAAc,8BAAL,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,mBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import script from './CnMarkdownEditor.vue2.js';
|
|
|
2
2
|
import { render } from './CnMarkdownEditor.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-697543a0";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { translate } from '@nextcloud/l10n';
|
|
2
2
|
import { cnRenderMarkdown } from '../../composables/cnRenderMarkdown.js';
|
|
3
|
+
import { guardedToastUiEditorClass } from '../../utils/toastUiRawHtmlGuard.js';
|
|
3
4
|
import { toastUiSanitizer } from '../../utils/toastUiSanitizer.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -334,7 +335,11 @@ var script = {
|
|
|
334
335
|
if (!el) {
|
|
335
336
|
return
|
|
336
337
|
}
|
|
337
|
-
|
|
338
|
+
// customHTMLSanitizer does not reach Toast UI's raw HTML
|
|
339
|
+
// converters, paste or setHTML; the guarded class routes those
|
|
340
|
+
// through DOMPurify 3 as well (see utils/toastUiRawHtmlGuard.js).
|
|
341
|
+
const GuardedEditor = guardedToastUiEditorClass(Editor);
|
|
342
|
+
this.toastEditor = new GuardedEditor({
|
|
338
343
|
el,
|
|
339
344
|
...this.wysiwygOptions,
|
|
340
345
|
initialValue: this.localValue,
|