smbls 3.6.1 → 3.6.4

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 CHANGED
@@ -197,4 +197,48 @@ See the [@symbo.ls/cli](../cli/) package for the full command reference.
197
197
 
198
198
  ## Documentation
199
199
 
200
+ ## Define System
201
+
202
+ The define system (`context.define` and `element.define`) maps special keys to handler functions. When a key with a matching define handler appears on an element, `throughInitialDefine` calls the handler instead of treating the key as a child or prop.
203
+
204
+ ### Built-in define handlers (in `defaultDefine`)
205
+
206
+ | Key | Purpose |
207
+ |-----|---------|
208
+ | `routes` | Route definitions — passed through as-is |
209
+ | `metadata` | SEO metadata — resolves and applies `<title>` and `<meta>` tags via helmet |
210
+ | `$router` | Router content — wraps params in a fragment and calls `el.set()` |
211
+
212
+ ### Collection define handlers (deprecated in v3)
213
+
214
+ The following collection define handlers existed in v2 but are **deprecated in v3**:
215
+
216
+ | Key (deprecated) | Data source | v3 replacement |
217
+ |-------------------|-------------|----------------|
218
+ | `$collection` | Direct data array/object | Use `children` + `childExtends` |
219
+ | `$propsCollection` | `element.props` as data source | Use `children: ({ props }) => props.items` |
220
+ | `$stateCollection` | `element.state` as data source | Use `children: ({ state }) => state.items` |
221
+ | `$setCollection` | Uses `set()` to update content | Use `content` or `children` |
222
+
223
+ Some older projects still use these handlers via project-level `context.define`. The framework's propertization layer (`@domql/utils/props.js`) is define-aware to avoid moving these keys into `props` when define handlers are present.
224
+
225
+ > **Lesson learned:** The `$` prefix overlaps between css-in-props selectors and define handlers. The propertization in `props.js` checks for define handlers before applying `CSS_SELECTOR_PREFIXES` to prevent define keys from being swallowed into props. This matters for backwards compatibility with v2 projects that still use `$propsCollection` etc.
226
+
227
+ ## Emotion Integration (`prepare.js`)
228
+
229
+ `prepareDesignSystem()` calls `initEmotion()` from `@symbo.ls/emotion/initEmotion.js` to initialize the CSS-in-JS engine. This import must be present for Emotion to work.
230
+
231
+ ```javascript
232
+ import { initEmotion } from '@symbo.ls/emotion/initEmotion.js'
233
+
234
+ export const prepareDesignSystem = (key, context) => {
235
+ const [scratchDesignSystem, emotion, registry] = initEmotion(key, context)
236
+ return [scratchDesignSystem, emotion, registry]
237
+ }
238
+ ```
239
+
240
+ > **Lesson learned:** If the `initEmotion` import is missing or broken, no CSS classes are generated and components render unstyled (Bazaar rendering issue).
241
+
242
+ ## Documentation
243
+
200
244
  For full documentation visit [symbols.app/developers](https://symbols.app/developers).
@@ -1 +1 @@
1
- {"name":"smbls","version":"3.6.0"}
1
+ {"name":"smbls","version":"3.6.3"}
@@ -24,7 +24,6 @@ module.exports = __toCommonJS(define_exports);
24
24
  var import_helmet = require("@symbo.ls/helmet");
25
25
  const defaultDefine = {
26
26
  routes: (param) => param,
27
- // deps: (param, el) => param || el.parent.deps,
28
27
  metadata: (param, el, state) => {
29
28
  if (!param) return;
30
29
  const doc = el.context?.document || typeof document !== "undefined" && document;
@@ -1 +1 @@
1
- {"name":"smbls","version":"3.6.0"}
1
+ {"name":"smbls","version":"3.6.3"}
@@ -1,7 +1,6 @@
1
1
  import { resolveMetadata, applyMetadata } from "@symbo.ls/helmet";
2
2
  const defaultDefine = {
3
3
  routes: (param) => param,
4
- // deps: (param, el) => param || el.parent.deps,
5
4
  metadata: (param, el, state) => {
6
5
  if (!param) return;
7
6
  const doc = el.context?.document || typeof document !== "undefined" && document;
@@ -498,7 +498,6 @@ var Smbls = (() => {
498
498
  var import_helmet = __require("@symbo.ls/helmet");
499
499
  var defaultDefine = {
500
500
  routes: (param) => param,
501
- // deps: (param, el) => param || el.parent.deps,
502
501
  metadata: (param, el, state) => {
503
502
  if (!param) return;
504
503
  const doc = el.context?.document || typeof document !== "undefined" && document;
@@ -1030,7 +1029,6 @@ var Smbls = (() => {
1030
1029
  var import_helmet2 = __require("@symbo.ls/helmet");
1031
1030
  var defaultDefine2 = {
1032
1031
  routes: (param) => param,
1033
- // deps: (param, el) => param || el.parent.deps,
1034
1032
  metadata: (param, el, state) => {
1035
1033
  if (!param) return;
1036
1034
  const doc = el.context?.document || typeof document !== "undefined" && document;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smbls",
3
- "version": "3.6.1",
3
+ "version": "3.6.4",
4
4
  "license": "MIT",
5
5
  "repository": "https://github.com/symbo-ls/smbls",
6
6
  "gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
@@ -28,21 +28,21 @@
28
28
  "src"
29
29
  ],
30
30
  "dependencies": {
31
- "@symbo.ls/emotion": "^3.6.1",
32
- "@symbo.ls/helmet": "^3.6.1",
33
- "@domql/report": "^3.6.1",
34
- "@domql/router": "^3.6.1",
35
- "@domql/utils": "^3.6.1",
36
- "@symbo.ls/cli": "^3.6.1",
37
- "@symbo.ls/default-config": "^3.6.1",
38
- "@symbo.ls/fetch": "^3.6.1",
39
- "@symbo.ls/scratch": "^3.6.1",
40
- "@symbo.ls/sync": "^3.6.1",
41
- "@symbo.ls/uikit": "^3.6.1",
42
- "@symbo.ls/smbls-utils": "^3.6.1",
43
- "attrs-in-props": "^3.6.1",
44
- "css-in-props": "^3.6.1",
45
- "domql": "^3.6.1"
31
+ "@symbo.ls/emotion": "^3.6.4",
32
+ "@symbo.ls/helmet": "^3.6.4",
33
+ "@domql/report": "^3.6.4",
34
+ "@domql/router": "^3.6.4",
35
+ "@domql/utils": "^3.6.4",
36
+ "@symbo.ls/cli": "^3.6.4",
37
+ "@symbo.ls/default-config": "^3.6.4",
38
+ "@symbo.ls/fetch": "^3.6.4",
39
+ "@symbo.ls/scratch": "^3.6.4",
40
+ "@symbo.ls/sync": "^3.6.4",
41
+ "@symbo.ls/uikit": "^3.6.4",
42
+ "@symbo.ls/smbls-utils": "^3.6.4",
43
+ "attrs-in-props": "^3.6.4",
44
+ "css-in-props": "^3.6.4",
45
+ "domql": "^3.6.4"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
package/src/define.js CHANGED
@@ -4,7 +4,6 @@ import { resolveMetadata, applyMetadata } from '@symbo.ls/helmet'
4
4
 
5
5
  export const defaultDefine = {
6
6
  routes: param => param,
7
- // deps: (param, el) => param || el.parent.deps,
8
7
 
9
8
  metadata: (param, el, state) => {
10
9
  if (!param) return