@conduction/nextcloud-vue 2.56.0-beta.35 → 2.56.0-beta.36
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/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +114 -0
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +2 -2
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +95 -0
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +24 -2
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue.js +1 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js +2 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +120 -65
- package/dist/esm/utils/gridStack.js +40 -1
- package/dist/esm/utils/gridStack.js.map +1 -1
- package/dist/esm/utils/humaniseKey.js +41 -0
- package/dist/esm/utils/humaniseKey.js.map +1 -0
- package/dist/esm/utils/notificationRuleLabel.js +6 -23
- package/dist/esm/utils/notificationRuleLabel.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +546 -256
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +120 -65
- package/package.json +1 -1
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +116 -2
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +123 -3
- package/src/components/CnWeekStripWidget/CnWeekStripWidget.vue +2 -1
- package/src/css/kpi-card.css +13 -0
- package/src/css/look-board.css +19 -0
- package/src/index.js +2 -0
- package/src/utils/gridStack.js +39 -0
- package/src/utils/humaniseKey.js +38 -0
- package/src/utils/notificationRuleLabel.js +5 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationRuleLabel.js","sources":["../../../src/utils/notificationRuleLabel.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * The label a person reads for one notification rule in their settings.\n *\n * A rule is declared in a schema's `x-openregister-notifications` map under a\n * KEY (`caseAssigned`, `clientUpdated`, `onCreate`). The key is an identifier\n * for a developer. The settings pane used to print it as is, so a person saw\n * \"substitutionRegisteredForSubstitute\" next to a switch and had to guess.\n *\n * The label is taken from the first source that has one, most specific first:\n *\n * 1. the rule's own words, when OpenRegister passes them on the preference\n * entry (`label`, then `title`), as a plain string or a per-locale map\n * like the dialect's `subject` (`{ \"nl\": \"…\", \"en\": \"…\" }`);\n * 2. the app's own label for the rule, from the `labels` map the app hands\n * to CnAppRoot (`notificationLabels`), keyed `<schema>.<key>` or `<key>`;\n * 3. the library's wording for the generic object-event keys;\n * 4. the key made readable: `caseAssigned` becomes \"Case assigned\".\n *\n * The rule's `subject` is used only when it carries no `{{placeholder}}`: it\n * is the notification TITLE template, and \"Case \"{{title}}\" assigned to you\"\n * reads worse as a setting than the readable key does.\n *\n * Pure: no store, no fetch, no Vue.\n *\n * @spec openspec/changes/notification-rule-labels-and-runtime-version/specs/notification-preferences/spec.md\n */\n\n/**\n * Pick the string for the current language out of a string or per-locale map.\n *\n * @param {string|object|null|undefined} value A string, or `{ nl, en, … }`.\n * @param {string} [language] The current language, e.g. `nl` or `de_DE`.\n * @return {string} The resolved text, or '' when there is none.\n */\nexport function resolveLocalised(value, language = 'en') {\n\tif (typeof value === 'string') {\n\t\treturn value.trim()\n\t}\n\tif (!value || typeof value !== 'object' || Array.isArray(value)) {\n\t\treturn ''\n\t}\n\tconst lang = String(language || 'en')\n\tconst base = lang.split(/[-_]/)[0]\n\tfor (const candidate of [lang, base, 'en']) {\n\t\tif (typeof value[candidate] === 'string' && value[candidate].trim() !== '') {\n\t\t\treturn value[candidate].trim()\n\t\t}\n\t}\n\tconst first = Object.values(value).find((text) => typeof text === 'string' && text.trim() !== '')\n\treturn first ? first.trim() : ''\n}\n\n/**\n * Make a rule key readable
|
|
1
|
+
{"version":3,"file":"notificationRuleLabel.js","sources":["../../../src/utils/notificationRuleLabel.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * The label a person reads for one notification rule in their settings.\n *\n * A rule is declared in a schema's `x-openregister-notifications` map under a\n * KEY (`caseAssigned`, `clientUpdated`, `onCreate`). The key is an identifier\n * for a developer. The settings pane used to print it as is, so a person saw\n * \"substitutionRegisteredForSubstitute\" next to a switch and had to guess.\n *\n * The label is taken from the first source that has one, most specific first:\n *\n * 1. the rule's own words, when OpenRegister passes them on the preference\n * entry (`label`, then `title`), as a plain string or a per-locale map\n * like the dialect's `subject` (`{ \"nl\": \"…\", \"en\": \"…\" }`);\n * 2. the app's own label for the rule, from the `labels` map the app hands\n * to CnAppRoot (`notificationLabels`), keyed `<schema>.<key>` or `<key>`;\n * 3. the library's wording for the generic object-event keys;\n * 4. the key made readable: `caseAssigned` becomes \"Case assigned\".\n *\n * The rule's `subject` is used only when it carries no `{{placeholder}}`: it\n * is the notification TITLE template, and \"Case \"{{title}}\" assigned to you\"\n * reads worse as a setting than the readable key does.\n *\n * Pure: no store, no fetch, no Vue.\n *\n * @spec openspec/changes/notification-rule-labels-and-runtime-version/specs/notification-preferences/spec.md\n */\n\nimport { humaniseKey } from './humaniseKey.js'\n\n/**\n * Pick the string for the current language out of a string or per-locale map.\n *\n * @param {string|object|null|undefined} value A string, or `{ nl, en, … }`.\n * @param {string} [language] The current language, e.g. `nl` or `de_DE`.\n * @return {string} The resolved text, or '' when there is none.\n */\nexport function resolveLocalised(value, language = 'en') {\n\tif (typeof value === 'string') {\n\t\treturn value.trim()\n\t}\n\tif (!value || typeof value !== 'object' || Array.isArray(value)) {\n\t\treturn ''\n\t}\n\tconst lang = String(language || 'en')\n\tconst base = lang.split(/[-_]/)[0]\n\tfor (const candidate of [lang, base, 'en']) {\n\t\tif (typeof value[candidate] === 'string' && value[candidate].trim() !== '') {\n\t\t\treturn value[candidate].trim()\n\t\t}\n\t}\n\tconst first = Object.values(value).find((text) => typeof text === 'string' && text.trim() !== '')\n\treturn first ? first.trim() : ''\n}\n\n/**\n * Make a rule key readable (`caseAssigned` → \"Case assigned\"); see `humaniseKey`.\n *\n * @param {string} key The rule key.\n * @return {string} A readable sentence-case label, or the key when it has no words.\n * @spec openspec/changes/notification-rule-labels-and-runtime-version/specs/notification-preferences/spec.md#requirement-a-notification-rule-reads-as-a-label\n */\nexport function humaniseRuleKey(key) {\n\treturn humaniseKey(key)\n}\n\n/**\n * The label for one preference entry.\n *\n * @param {object} entry A preference entry: `{ schema, notification, label?, title?, subject? }`.\n * @param {object} [options] Where else a label may come from.\n * @param {object} [options.labels] App-supplied labels keyed `<schema>.<key>` or `<key>`;\n * values are strings or per-locale maps.\n * @param {object} [options.known] Library wording for generic keys, keyed by rule key.\n * @param {string} [options.language] The current language.\n * @return {string} The label to show.\n */\nexport function notificationRuleLabel(entry, { labels = {}, known = {}, language = 'en' } = {}) {\n\tconst key = String(entry?.notification ?? '')\n\tconst schema = String(entry?.schema ?? '')\n\n\tfor (const field of ['label', 'title']) {\n\t\tconst own = resolveLocalised(entry?.[field], language)\n\t\tif (own) {\n\t\t\treturn own\n\t\t}\n\t}\n\n\tconst map = labels && typeof labels === 'object' ? labels : {}\n\tfor (const lookup of [schema ? `${schema}.${key}` : '', key]) {\n\t\tif (lookup && Object.hasOwn(map, lookup)) {\n\t\t\tconst fromApp = resolveLocalised(map[lookup], language)\n\t\t\tif (fromApp) {\n\t\t\t\treturn fromApp\n\t\t\t}\n\t\t}\n\t}\n\n\tif (known && typeof known[key] === 'string' && known[key]) {\n\t\treturn known[key]\n\t}\n\n\tconst subject = resolveLocalised(entry?.subject, language)\n\tif (subject && !subject.includes('{{')) {\n\t\treturn subject\n\t}\n\n\treturn humaniseRuleKey(key)\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE;AACzD,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAChC,EAAE,OAAO,KAAK,CAAC,IAAI,EAAE;AACrB,EAAE;AACF,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAClE,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAC;AACtC,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC;AACnC,CAAC,KAAK,MAAM,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;AAC7C,EAAE,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EA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