snice 7.1.0 → 7.1.1
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/README.md +5 -0
- package/adapters/react/SniceProvider.js +1 -1
- package/adapters/react/SniceRouter.js +1 -1
- package/adapters/react/matchRoute.js +1 -1
- package/adapters/react/useRequestHandler.js +1 -1
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/binpack/snice-binpack.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/button/snice-button.js +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/grid/snice-grid.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/login/snice-login.js +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/popover/snice-popover.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/runtime/README.md +2 -2
- package/dist/cdn/runtime/snice-runtime.esm.js +114 -15
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +114 -15
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/table/snice-table.esm.js +1 -1
- package/dist/cdn/table/snice-table.js +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/controller.d.ts +5 -0
- package/dist/index.cjs +111 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +111 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +111 -12
- package/dist/index.iife.js.map +1 -1
- package/dist/parts.d.ts +2 -2
- package/dist/react/SniceProvider.js +1 -1
- package/dist/react/SniceRouter.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/matchRoute.js +1 -1
- package/dist/react/useRequestHandler.js +1 -1
- package/dist/symbols.cjs +9 -1
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.d.ts +2 -0
- package/dist/symbols.esm.js +8 -2
- package/dist/symbols.esm.js.map +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/architecture.md +1 -1
- package/docs/ai/bindings.md +1 -1
- package/docs/ai/controllers.md +1 -1
- package/docs/ai/decorators.md +1 -1
- package/docs/ai/patterns.md +4 -3
- package/docs/bindings.md +1 -1
- package/docs/controllers.md +8 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* snice v7.1.
|
|
2
|
+
* snice v7.1.1
|
|
3
3
|
* A decorator-driven web component library with routing, controllers, daemons, and 130+ UI components. For better coding-agent results, run npx snice init-ai.
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -8,7 +8,7 @@ var Snice = (function (exports) {
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
/*!
|
|
11
|
-
* snice v7.0
|
|
11
|
+
* snice v7.1.0
|
|
12
12
|
* A decorator-driven web component library with routing, controllers, daemons, and 130+ UI components. For better coding-agent results, run npx snice init-ai.
|
|
13
13
|
* (c) 2024
|
|
14
14
|
* Released under the MIT License.
|
|
@@ -69,9 +69,15 @@ var Snice = (function (exports) {
|
|
|
69
69
|
const CONTROLLER_ID = getSymbol('controller-id');
|
|
70
70
|
const CONTROLLER_OPERATIONS = getSymbol('controller-operations');
|
|
71
71
|
const NATIVE_CONTROLLER = getSymbol('native-controller');
|
|
72
|
+
// Decorator name stored on the class so direct class bindings can expose the
|
|
73
|
+
// same useful DOM label without resolving the controller through the registry.
|
|
74
|
+
const CONTROLLER_REGISTRY_NAME = getSymbol('controller-registry-name');
|
|
72
75
|
// Set while a controller CLASS (not a registry name) is attached — the
|
|
73
76
|
// attribute/MutationObserver channel must not attach over or detach it.
|
|
74
77
|
const DIRECT_CONTROLLER = getSymbol('direct-controller');
|
|
78
|
+
// Guards framework-authored diagnostic controller attribute writes from the
|
|
79
|
+
// synchronous custom-element attributeChangedCallback path.
|
|
80
|
+
const CONTROLLER_ATTRIBUTE_SYNC = getSymbol('controller-attribute-sync');
|
|
75
81
|
// A controller class bound by a template before the custom element was
|
|
76
82
|
// defined/upgraded. Picked up by connectedCallback on first initialization.
|
|
77
83
|
const PENDING_CONTROLLER_BINDING = getSymbol('pending-controller-binding');
|
|
@@ -2129,6 +2135,12 @@ var Snice = (function (exports) {
|
|
|
2129
2135
|
registry.set(name, constructor);
|
|
2130
2136
|
// Mark as controller class for channel decorator detection
|
|
2131
2137
|
constructor.prototype[IS_CONTROLLER_CLASS] = true;
|
|
2138
|
+
// Preserve the registry name on the class. Direct class attachments still
|
|
2139
|
+
// skip registry lookup; this is only their inspectable DOM label.
|
|
2140
|
+
Object.defineProperty(constructor, CONTROLLER_REGISTRY_NAME, {
|
|
2141
|
+
value: name,
|
|
2142
|
+
configurable: true
|
|
2143
|
+
});
|
|
2132
2144
|
const pending = snice.pendingControllerAttachments.get(name);
|
|
2133
2145
|
if (pending) {
|
|
2134
2146
|
snice.pendingControllerAttachments.delete(name);
|
|
@@ -2200,6 +2212,52 @@ var Snice = (function (exports) {
|
|
|
2200
2212
|
? controller
|
|
2201
2213
|
: (controller?.name || '(anonymous controller class)');
|
|
2202
2214
|
}
|
|
2215
|
+
/** Registry/decorator name used for a direct class attachment's DOM marker. */
|
|
2216
|
+
function directControllerAttributeName(controllerClass) {
|
|
2217
|
+
const registeredName = Object.prototype.hasOwnProperty.call(controllerClass, CONTROLLER_REGISTRY_NAME)
|
|
2218
|
+
? controllerClass[CONTROLLER_REGISTRY_NAME]
|
|
2219
|
+
: undefined;
|
|
2220
|
+
return typeof registeredName === 'string'
|
|
2221
|
+
? registeredName
|
|
2222
|
+
: controllerLabel(controllerClass);
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* Write the inspectable controller marker without feeding it back into the
|
|
2226
|
+
* custom-element attribute channel. Native MutationObservers are asynchronous
|
|
2227
|
+
* and are excluded independently by DIRECT_CONTROLLER.
|
|
2228
|
+
*/
|
|
2229
|
+
function writeControllerAttribute(element, value) {
|
|
2230
|
+
if (value === null) {
|
|
2231
|
+
if (!element.hasAttribute('controller'))
|
|
2232
|
+
return;
|
|
2233
|
+
}
|
|
2234
|
+
else if (element.getAttribute('controller') === value) {
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2237
|
+
element[CONTROLLER_ATTRIBUTE_SYNC] = true;
|
|
2238
|
+
try {
|
|
2239
|
+
if (value === null)
|
|
2240
|
+
element.removeAttribute('controller');
|
|
2241
|
+
else
|
|
2242
|
+
element.setAttribute('controller', value);
|
|
2243
|
+
}
|
|
2244
|
+
finally {
|
|
2245
|
+
delete element[CONTROLLER_ATTRIBUTE_SYNC];
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Restore the diagnostic attribute for an attached class controller. Returns
|
|
2250
|
+
* true when the direct class channel owns the element.
|
|
2251
|
+
*/
|
|
2252
|
+
function restoreDirectControllerAttribute(element) {
|
|
2253
|
+
if (!element[DIRECT_CONTROLLER])
|
|
2254
|
+
return false;
|
|
2255
|
+
const source = element[CONTROLLER_NAME_KEY];
|
|
2256
|
+
if (typeof source !== 'function')
|
|
2257
|
+
return false;
|
|
2258
|
+
writeControllerAttribute(element, directControllerAttributeName(source));
|
|
2259
|
+
return true;
|
|
2260
|
+
}
|
|
2203
2261
|
/**
|
|
2204
2262
|
* Attaches a controller to an element
|
|
2205
2263
|
* @param element The element to attach the controller to
|
|
@@ -2229,11 +2287,26 @@ var Snice = (function (exports) {
|
|
|
2229
2287
|
}
|
|
2230
2288
|
if (existingSource === controller && existingController) {
|
|
2231
2289
|
// Already attached and controller exists (name or class reference match)
|
|
2290
|
+
if (typeof controller !== 'string') {
|
|
2291
|
+
restoreDirectControllerAttribute(element);
|
|
2292
|
+
}
|
|
2232
2293
|
return;
|
|
2233
2294
|
}
|
|
2234
2295
|
// If there's an existing controller, detach it first
|
|
2235
2296
|
if (existingController) {
|
|
2236
2297
|
await detachController(element);
|
|
2298
|
+
// Light-DOM reconciliation can issue commit() and reconnected() requests
|
|
2299
|
+
// for the same class while the previous controller is still detaching.
|
|
2300
|
+
// If the other request already installed that exact source, this request
|
|
2301
|
+
// is redundant. Different sources retain the established rapid-switch
|
|
2302
|
+
// behavior and continue through the normal replacement path.
|
|
2303
|
+
const replacement = element[CONTROLLER_KEY];
|
|
2304
|
+
const replacementSource = element[CONTROLLER_NAME_KEY];
|
|
2305
|
+
if (replacement && replacementSource === controller) {
|
|
2306
|
+
if (typeof controller !== 'string')
|
|
2307
|
+
restoreDirectControllerAttribute(element);
|
|
2308
|
+
return;
|
|
2309
|
+
}
|
|
2237
2310
|
}
|
|
2238
2311
|
let ControllerClass;
|
|
2239
2312
|
if (typeof controller === 'string') {
|
|
@@ -2249,13 +2322,16 @@ var Snice = (function (exports) {
|
|
|
2249
2322
|
}
|
|
2250
2323
|
else {
|
|
2251
2324
|
ControllerClass = controller;
|
|
2252
|
-
// The class channel owns the element from here on: the attribute /
|
|
2253
|
-
// MutationObserver channel goes inert and its bookkeeping is dropped.
|
|
2254
|
-
element[DIRECT_CONTROLLER] = true;
|
|
2255
|
-
delete element[NATIVE_CONTROLLER];
|
|
2256
2325
|
}
|
|
2257
2326
|
// Create controller instance with unique ID and scope
|
|
2258
2327
|
const controllerInstance = new ControllerClass();
|
|
2328
|
+
if (typeof controller !== 'string') {
|
|
2329
|
+
// Construction succeeded, so the class channel can safely take ownership.
|
|
2330
|
+
// Setting this before construction would leave a stale observer guard when
|
|
2331
|
+
// a controller constructor throws.
|
|
2332
|
+
element[DIRECT_CONTROLLER] = true;
|
|
2333
|
+
delete element[NATIVE_CONTROLLER];
|
|
2334
|
+
}
|
|
2259
2335
|
snice.controllerIdCounter += 1;
|
|
2260
2336
|
const controllerId = snice.controllerIdCounter;
|
|
2261
2337
|
const scope = new ControllerScope();
|
|
@@ -2274,6 +2350,12 @@ var Snice = (function (exports) {
|
|
|
2274
2350
|
element[CONTROLLER_KEY] = controllerInstance;
|
|
2275
2351
|
element[CONTROLLER_NAME_KEY] = controller;
|
|
2276
2352
|
element[CONTROLLER_OPERATIONS] = scope;
|
|
2353
|
+
if (typeof controller !== 'string') {
|
|
2354
|
+
// The class reference remains the sole attachment authority. This
|
|
2355
|
+
// attribute is diagnostic only; custom-element callbacks and native
|
|
2356
|
+
// MutationObservers are guarded from treating it as a string attachment.
|
|
2357
|
+
restoreDirectControllerAttribute(element);
|
|
2358
|
+
}
|
|
2277
2359
|
// Wait for element to be ready. Race against abort (detachController) and
|
|
2278
2360
|
// a 30s deadline so a caller that forgets to append the element gets a
|
|
2279
2361
|
// clear error instead of an unresolvable promise.
|
|
@@ -2305,6 +2387,9 @@ var Snice = (function (exports) {
|
|
|
2305
2387
|
// attached — otherwise a later attach short-circuits as "already attached"
|
|
2306
2388
|
// and a detach would run detach() on it.
|
|
2307
2389
|
if (element[CONTROLLER_KEY] === controllerInstance) {
|
|
2390
|
+
if (typeof controller !== 'string') {
|
|
2391
|
+
writeControllerAttribute(element, null);
|
|
2392
|
+
}
|
|
2308
2393
|
delete element[CONTROLLER_KEY];
|
|
2309
2394
|
delete element[CONTROLLER_NAME_KEY];
|
|
2310
2395
|
delete element[CONTROLLER_OPERATIONS];
|
|
@@ -2356,6 +2441,12 @@ var Snice = (function (exports) {
|
|
|
2356
2441
|
// controller reassignment) finds no instance and returns, instead of running
|
|
2357
2442
|
// detach() a second time on the same controller. The rest of this function
|
|
2358
2443
|
// works off the locals captured above.
|
|
2444
|
+
if (typeof controllerSource === 'function') {
|
|
2445
|
+
// Remove the class channel's diagnostic marker while its guards are still
|
|
2446
|
+
// active. A queued native MutationObserver therefore sees no attribute and
|
|
2447
|
+
// cannot resurrect a registry attachment after detach.
|
|
2448
|
+
writeControllerAttribute(element, null);
|
|
2449
|
+
}
|
|
2359
2450
|
delete element[CONTROLLER_KEY];
|
|
2360
2451
|
delete element[CONTROLLER_NAME_KEY];
|
|
2361
2452
|
delete element[CONTROLLER_OPERATIONS];
|
|
@@ -2430,8 +2521,12 @@ var Snice = (function (exports) {
|
|
|
2430
2521
|
// attachController(el, Class)). The class channel owns the element:
|
|
2431
2522
|
// attribute writes must not attach over it, and insertion sweeps must
|
|
2432
2523
|
// not detach it.
|
|
2433
|
-
if (element[DIRECT_CONTROLLER])
|
|
2524
|
+
if (element[DIRECT_CONTROLLER]) {
|
|
2525
|
+
// External writes cannot replace a class binding. Keep the DOM marker
|
|
2526
|
+
// honest about the class that is actually attached.
|
|
2527
|
+
restoreDirectControllerAttribute(element);
|
|
2434
2528
|
return;
|
|
2529
|
+
}
|
|
2435
2530
|
const controllerName = element.getAttribute('controller');
|
|
2436
2531
|
const currentControllerName = element[NATIVE_CONTROLLER];
|
|
2437
2532
|
// No change
|
|
@@ -4669,8 +4764,8 @@ var Snice = (function (exports) {
|
|
|
4669
4764
|
* Accepts a controller class decorated with @controller (attached directly,
|
|
4670
4765
|
* no registry lookup) or a registry name string (delegated to the attribute
|
|
4671
4766
|
* channel with the exact semantics of a static controller="name"). While a
|
|
4672
|
-
* class is bound it owns the element: the
|
|
4673
|
-
*
|
|
4767
|
+
* class is bound it owns the element: the decorator name is reflected for
|
|
4768
|
+
* inspection, while the attribute/MutationObserver attach channel stays inert.
|
|
4674
4769
|
*
|
|
4675
4770
|
* Renders commit while the tree is detached and connect afterwards, so
|
|
4676
4771
|
* attachment happens on reconnected()/connected commits; every hook is
|
|
@@ -4709,10 +4804,6 @@ var Snice = (function (exports) {
|
|
|
4709
4804
|
}
|
|
4710
4805
|
}
|
|
4711
4806
|
if (typeof next === 'function') {
|
|
4712
|
-
// Class binding takes over — drop any attribute so the string channel
|
|
4713
|
-
// cannot fight it.
|
|
4714
|
-
if (this.element.hasAttribute('controller'))
|
|
4715
|
-
this.element.removeAttribute('controller');
|
|
4716
4807
|
if (this.isConnected) {
|
|
4717
4808
|
this._apply(next);
|
|
4718
4809
|
}
|
|
@@ -6784,6 +6875,14 @@ var Snice = (function (exports) {
|
|
|
6784
6875
|
constructor.prototype.attributeChangedCallback = function (name, oldValue, newValue) {
|
|
6785
6876
|
originalAttributeChangedCallback?.call(this, name, oldValue, newValue);
|
|
6786
6877
|
if (name === 'controller') {
|
|
6878
|
+
// A class attachment reflects its decorator name for DOM diagnostics,
|
|
6879
|
+
// but the class reference remains the only attachment authority.
|
|
6880
|
+
if (this[CONTROLLER_ATTRIBUTE_SYNC])
|
|
6881
|
+
return;
|
|
6882
|
+
if (this[DIRECT_CONTROLLER]) {
|
|
6883
|
+
restoreDirectControllerAttribute(this);
|
|
6884
|
+
return;
|
|
6885
|
+
}
|
|
6787
6886
|
this.controller = newValue;
|
|
6788
6887
|
return;
|
|
6789
6888
|
}
|
|
@@ -9257,7 +9356,7 @@ var Snice = (function (exports) {
|
|
|
9257
9356
|
}
|
|
9258
9357
|
|
|
9259
9358
|
/*!
|
|
9260
|
-
* snice v7.0
|
|
9359
|
+
* snice v7.1.0
|
|
9261
9360
|
* A decorator-driven web component library with routing, controllers, daemons, and 130+ UI components. For better coding-agent results, run npx snice init-ai.
|
|
9262
9361
|
* (c) 2024
|
|
9263
9362
|
* Released under the MIT License.
|
|
@@ -9279,7 +9378,7 @@ var Snice = (function (exports) {
|
|
|
9279
9378
|
globalThis.snice.pendingControllerAttachments ??= new Map();
|
|
9280
9379
|
|
|
9281
9380
|
/*!
|
|
9282
|
-
* snice v7.0
|
|
9381
|
+
* snice v7.1.0
|
|
9283
9382
|
* A decorator-driven web component library with routing, controllers, daemons, and 130+ UI components. For better coding-agent results, run npx snice init-ai.
|
|
9284
9383
|
* (c) 2024
|
|
9285
9384
|
* Released under the MIT License.
|