@cratis/scene.blueprint.components 2.0.0 → 3.0.0

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.
@@ -2,20 +2,16 @@
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
4
  import type { Preview } from '@storybook/react';
5
+ import { PrimeReactProvider } from '@primereact/core';
5
6
  import { CratisComponentsProvider } from '@cratis/components/Common';
6
7
 
7
- // The stylesheet layers a page in this blueprint needs, in the order they resolve. PrimeReact 11 ships
8
- // zero CSS - `primereact/resources/themes/*` does not exist any more - and `@cratis/components` 3.0.0 took
9
- // its own CSS out of the JavaScript module graph, so every sheet below is an explicit import rather than
10
- // something a bundler injects behind an `import './Foo.css'`.
8
+ // The stylesheet layers a page in this blueprint needs, in the order they resolve. Components 4 owns its
9
+ // own CSS outright and keeps it out of the JavaScript module graph, so every sheet below is an explicit
10
+ // import rather than something a bundler injects behind an `import './Foo.css'`.
11
11
  //
12
12
  // `tokens` defines the `--cratis-*` layer, `styles` is every component stylesheet plus the Tailwind
13
13
  // utilities that consume it, and `theme` is the Cratis-authored MIT baseline that assigns those tokens
14
- // actual values. That order matters: the last two both read the first. `theme` is what gives this preview
15
- // a look at all, because with no `@primeuix/themes` preset there are no `--p-*` values for the tokens to
16
- // resolve to - which also means the raw PrimeReact widgets the default blueprint's shell renders come out
17
- // structural rather than styled. That is the honest picture of an unstyled-first host, and this package
18
- // takes no dependency on a preset to paper over it.
14
+ // actual values. That order matters: the last two both read the first.
19
15
  //
20
16
  // The Scene package's bridge puts Scene's `--scene-*` tokens in front of that, and the default blueprint's
21
17
  // `layout.css` draws the shell every one of these pages sits inside - which is the sheet this package does
@@ -31,24 +27,31 @@ import 'primeicons/primeicons.css';
31
27
  import '../../components/theme/sceneTokenBridge.css';
32
28
  import '../../blueprint.default/shell/layout.css';
33
29
 
30
+ // The baseline theme is scoped to a `cratis-theme` ancestor rather than to `:root`, so something has to
31
+ // carry the class, and overlays portal to the body rather than into the story's subtree.
32
+ document.body.classList.add('cratis-theme');
33
+
34
34
  /**
35
- * Every story renders inside `CratisComponentsProvider`, the library's own configuration provider over
36
- * PrimeReact's. Without it the wrapped components fall back to PrimeReact's defaults rather than Cratis',
37
- * so a story would show something subtly different from what an application renders - which defeats the
38
- * point of having stories at all.
35
+ * Two providers, because these pages are two things at once.
36
+ *
37
+ * The page bodies are Components 4, which owns its own markup and configuration and no longer sits on
38
+ * PrimeReact at all - `CratisComponentsProvider` now carries only what the library itself owns.
39
39
  *
40
- * On PrimeReact 11 it is also load-bearing rather than merely advisable: every v11 component resolves its
41
- * configuration, theme and z-index registry through `PrimeReactProvider`, which this wraps, and throws
42
- * outright without one. These pages sit inside the default blueprint's shell, which reaches for PrimeReact
43
- * directly in five places, so removing this decorator would not degrade the stories - it would stop them
44
- * rendering.
40
+ * The shell they sit inside is the default blueprint's, and that reaches for PrimeReact directly in five
41
+ * places (`Topbar`, `Sidebar`, `Breadcrumb`, `UserMenu`, `ConfigPanel`). Every PrimeReact 11 component
42
+ * resolves its configuration, theme and z-index registry through `PrimeReactProvider` and throws without
43
+ * one. Until Components 3 that provider came for free, because `CratisComponentsProvider` wrapped it;
44
+ * under Components 4 it does not, so this preview supplies it explicitly. Dropping it would not degrade
45
+ * these stories - it would stop them rendering.
45
46
  */
46
47
  const preview: Preview = {
47
48
  decorators: [
48
49
  Story => (
49
- <CratisComponentsProvider>
50
- <Story />
51
- </CratisComponentsProvider>
50
+ <PrimeReactProvider>
51
+ <CratisComponentsProvider value={{ locale: 'en-US' }}>
52
+ <Story />
53
+ </CratisComponentsProvider>
54
+ </PrimeReactProvider>
52
55
  ),
53
56
  ],
54
57
  parameters: {
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Scene
2
2
 
3
+ **Describing a user interface without describing a platform** — Scene is the UI model of the Cratis
4
+ model-first layer (experimental).
5
+
3
6
  The object model and runtime for Screenplay-based UIs: `Scene.Model` (platform-agnostic screens, layouts,
4
7
  forms, contribution points, ui profiles and themes), `Scene.Engine` (binding/resolution runtime), and
5
8
  `Scene.React` (the React renderer).
@@ -18,8 +21,13 @@ forms, contribution points, ui profiles and themes), `Scene.Engine` (binding/res
18
21
 
19
22
  ## Description
20
23
 
21
- Scene owns the *object model and runtime* half of the Screenplay stack. `Scene.Model` is the platform-agnostic
22
- C# object model that Stage translates Screenplay's parsed language constructs into, and that Studio's
24
+ Scene owns the *object model and runtime* half of the Screenplay stack. In the model-first pipeline,
25
+ [Screenplay](https://github.com/Cratis/Screenplay) describes an event-sourced, CQRS system,
26
+ [Stage](https://github.com/Cratis/Stage) renders it into a running application, and Scene is how that
27
+ application's user interface is described — independently of any rendering platform.
28
+
29
+ `Scene.Model` is the platform-agnostic
30
+ C# object model that [Stage](https://github.com/Cratis/Stage) translates Screenplay's parsed language constructs into, and that [Studio](https://github.com/Cratis/Studio)'s
23
31
  design-time tooling reads and writes. `Scene.Engine` walks that graph, resolves bindings (data, action, form,
24
32
  navigation contribution) and drives whichever renderer is plugged in — it does not know React exists.
25
33
  `Scene.React` is one renderer implementing the abstract vocabulary against real React/DOM; sibling positions
@@ -38,3 +46,22 @@ Cratis is an open community, and we are glad to help users, teams evaluating the
38
46
  | Discord | Join the community on [Discord](https://discord.gg/kt4AMpV8WV) for questions and discussions |
39
47
  | GitHub Issues | [Report bugs or request features](https://github.com/Cratis/Scene/issues) |
40
48
  | Documentation | Read the docs at [cratis.io](https://cratis.io) |
49
+
50
+ ## The Cratis ecosystem
51
+
52
+ This project is part of [Cratis](https://www.cratis.io) — free, MIT-licensed tools for building event-sourced and CQRS applications.
53
+
54
+ - **[Chronicle](https://github.com/Cratis/Chronicle)** — event-sourcing database and runtime. Orleans-based kernel, pluggable storage (MongoDB default; PostgreSQL, SQL Server, SQLite, in-memory), language-agnostic gRPC contracts. [Docs](https://www.cratis.io/chronicle/)
55
+ - **Chronicle clients** — first-class [.NET SDK](https://github.com/Cratis/Chronicle), plus [TypeScript](https://github.com/Cratis/Chronicle.TypeScript), [Kotlin/Java](https://github.com/Cratis/Chronicle.Kotlin), and [Elixir](https://github.com/Cratis/Chronicle.Elixir); [Python](https://github.com/Cratis/Chronicle.Python) coming soon (pre-alpha). AI agents connect through the [Chronicle MCP server](https://github.com/Cratis/Chronicle.Mcp).
56
+ - **[Arc](https://github.com/Cratis/Arc)** — opinionated CQRS framework for ASP.NET Core with commands, queries, validation, authorization, and TypeScript proxy generation. Works without event sourcing. [Docs](https://www.cratis.io/arc/)
57
+ - **[Components](https://github.com/Cratis/Components)** — React components aligned with Arc patterns. [Docs](https://www.cratis.io/components/)
58
+ - **[CLI](https://github.com/Cratis/cli) + Workbench** — inspect and diagnose Chronicle from the terminal or the browser. [Docs](https://www.cratis.io/cli/)
59
+ - **Model-first layer (experimental)** — [Studio](https://github.com/Cratis/Studio), [Screenplay](https://github.com/Cratis/Screenplay), [Stage](https://github.com/Cratis/Stage), Scene (this repository), [Prologue](https://github.com/Cratis/Prologue)
60
+ - **Supporting** — [Fundamentals](https://github.com/Cratis/Fundamentals), [Specifications](https://github.com/Cratis/Specifications), [Synopsis](https://github.com/Cratis/Synopsis), [Lens](https://github.com/Cratis/Lens), [Narrator](https://github.com/Cratis/Narrator), and free [AI tooling](https://github.com/Cratis/AI) (preview); [Ensemble](https://github.com/Cratis/Ensemble) coming soon (pre-release)
61
+ - **[Samples](https://github.com/Cratis/Samples)** — runnable event sourcing and CQRS samples for the whole stack
62
+
63
+ Everything Cratis publishes today is MIT licensed and free to use.
64
+
65
+ ---
66
+
67
+ Part of the [Cratis](https://www.cratis.io) platform · [MIT](./LICENSE)