@fluid-app/fluid-cli-theme-dev 0.1.214 → 0.1.216

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.
@@ -15,9 +15,11 @@
15
15
 
16
16
  Blocks have a Liquid value called `fluid_attributes` that emits the `data-fluid-section-*` attributes the visual editor uses to find, select, click-to-edit, and drag-to-reorder the block. **Without these attributes on the block's root element, the editor cannot interact with the block** — click handlers don't bind, inspector panels don't open, drag-and-drop is dead.
17
17
 
18
- > **Note:** Despite the `data-fluid-*` prefix, these are _editor_ attributes — not the same as the runtime [FairShare behavioral attributes](fairshare-attributes.md) (which wire up cart, checkout, enrollment behavior). Keep them straight: `block.fluid_attributes` is emitted by the _theme engine_ in editor mode; FairShare attributes are _hand-written_ HTML attributes that the FairShare runtime SDK reads.
18
+ > **Note:** Despite the `data-fluid-*` prefix, these are _editor_ attributes — not the same as the runtime [FairShare behavioral attributes](fairshare-attributes.md) (which wire up cart, checkout, enrollment behavior). Keep them straight: `block.fluid_attributes` is emitted by the _theme engine_ (the full set in editor mode, the two-attribute pair in production for companies with `STOREFRONT_BLOCK_IDS` on); FairShare attributes are _hand-written_ HTML attributes that the FairShare runtime SDK reads.
19
19
 
20
- These attributes are only populated in editor preview mode; in production rendering, the drops emit an empty string. So a missing call has zero visible effect at runtime — the bug only surfaces in the editor. That's why reviewers must catch it.
20
+ The editor attribute set is only populated in editor preview mode. In production rendering `block.fluid_attributes` is an empty string by default. Only for a company with the `STOREFRONT_BLOCK_IDS` feature flag on does it carry a smaller pair: `data-fluid-block-id` and `data-fluid-block-type`, nothing else. They name the block so a comment pinned on a live page can say which block it is on. A missing call therefore has no visible effect at runtime — the bug only surfaces in the editor. That's why reviewers must catch it.
21
+
22
+ Never test for the editor with a blank `block.fluid_attributes` (for example `block.fluid_attributes | strip != blank`), with `[data-fluid-section-block-id]` or any other editor-only attribute, or by keying behavior off `data-fluid-block-id` or `data-fluid-block-type`. The production pair is not an editor signal, and the value is non-blank on a live page once the flag is on, so a theme that reads non-blank as "in the editor" changes behavior for visitors (a gating veil drops, an editor-only key list shows). Fluid exposes no Liquid editor flag; build the page so it renders correctly with or without these attributes.
21
23
 
22
24
  ### What `fluid_attributes` emits
23
25
 
@@ -33,6 +35,12 @@ In editor mode, `{{ block.fluid_attributes }}` expands to the full set of `data-
33
35
  ></div>
34
36
  ```
35
37
 
38
+ In production the same expression expands to just the pair, and only for a company with `STOREFRONT_BLOCK_IDS` on (otherwise it is empty):
39
+
40
+ ```html
41
+ <div data-fluid-block-id="abc123" data-fluid-block-type="heading"></div>
42
+ ```
43
+
36
44
  ### Sections are wrapped for you
37
45
 
38
46
  Fluid renders every section inside a wrapper element carrying `data-fluid-section="<id>"` and `data-fluid-section-type="<name>"`, in every render, editor or not. **A section needs no editor attributes of its own.** `section.fluid_attributes` does not exist — `{{ section.fluid_attributes }}` renders an empty string, so adding it changes nothing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/fluid-cli-theme-dev",
3
- "version": "0.1.214",
3
+ "version": "0.1.216",
4
4
  "description": "Fluid CLI plugin for theme developer workflows — dev server, push, pull, init, crawl, compare",
5
5
  "files": [
6
6
  "dist",