@feezal/feezal-element 3.0.9 → 3.0.10
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/feezal-element.js +26 -0
- package/package.json +1 -1
package/feezal-element.js
CHANGED
|
@@ -502,6 +502,32 @@ export const publishLocalAttribute = {
|
|
|
502
502
|
help: 'Publish page-locally instead of to the broker: the payload reaches only subscribers in THIS browser tab (dialog triggers, view switches, wiring elements together). Nothing is sent over MQTT, nothing is retained, and it works while disconnected.'
|
|
503
503
|
};
|
|
504
504
|
|
|
505
|
+
/**
|
|
506
|
+
* E142: shared descriptor for a dialog's editor-only `label` — spread into every
|
|
507
|
+
* dialog element's `feezal.attributes` so the wording never drifts. The element
|
|
508
|
+
* declares `label: {type: String, reflect: true}` and renders its placeholder
|
|
509
|
+
* text through `dialogPlaceholderLabel()`. Distinct from a dialog's `title`,
|
|
510
|
+
* which IS shown to the user as the heading — `label` is never rendered in the
|
|
511
|
+
* viewer; it exists purely to tell multiple dialogs apart on the canvas.
|
|
512
|
+
*/
|
|
513
|
+
export const dialogLabelAttribute = {
|
|
514
|
+
name: 'label',
|
|
515
|
+
type: 'string',
|
|
516
|
+
default: '',
|
|
517
|
+
help: 'Editor-only label shown on the canvas placeholder to tell multiple dialogs apart (e.g. "Dialog: Confirm delete"). Never shown in the viewer — unlike "title", which is the dialog heading users see.'
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* E142: editor-only placeholder text for a dialog pseudo-element. Appends the
|
|
522
|
+
* disambiguating `label` when set ("Dialog" → "Dialog: Confirm delete"), else
|
|
523
|
+
* returns the base word unchanged. Used only inside the `feezal.isEditor`
|
|
524
|
+
* placeholder branch — never in the viewer.
|
|
525
|
+
*/
|
|
526
|
+
export function dialogPlaceholderLabel(base, label) {
|
|
527
|
+
const l = (label || '').trim();
|
|
528
|
+
return l ? `${base}: ${l}` : base;
|
|
529
|
+
}
|
|
530
|
+
|
|
505
531
|
/**
|
|
506
532
|
* E137 — payload comparison, cross-controller shared machinery: string
|
|
507
533
|
* coercion (case-insensitive) plus boolean true/false matching the HA/z2m
|
package/package.json
CHANGED