@cratis/scene.blueprint.components 1.0.0 → 2.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.
- package/.storybook/main.ts +0 -7
- package/.storybook/preview.tsx +23 -6
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js +2 -1
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js.map +1 -1
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js +1 -1
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/for_ArcPageHeader/when_rendering_a_gallery_screen.tsx +12 -5
- package/for_componentsBlueprint/when_resolving_its_dependencies.ts +10 -2
- package/package.json +24 -18
package/.storybook/main.ts
CHANGED
|
@@ -44,13 +44,6 @@ const config: StorybookConfig = {
|
|
|
44
44
|
...(config.build.rollupOptions ?? {}),
|
|
45
45
|
external: [/^@cratis\/arc/, '@cratis/fundamentals'],
|
|
46
46
|
};
|
|
47
|
-
// Vite 8 minifies CSS with lightningcss, which rejects the whole bundle over one invalid file:
|
|
48
|
-
// `@cratis/components` ships `dist/esm/TimeMachine/Properties.css` with `//` line comments, which
|
|
49
|
-
// are not CSS. esbuild's minifier tolerates them. This blueprint is the first package here to place
|
|
50
|
-
// a `timeMachine` on a page, so it is the first to pull that file in. The same workaround is in the
|
|
51
|
-
// Cratis Components package's own preview tooling, and both come out once that file ships with
|
|
52
|
-
// `/* */` comments.
|
|
53
|
-
config.build.cssMinify = 'esbuild';
|
|
54
47
|
return config;
|
|
55
48
|
},
|
|
56
49
|
};
|
package/.storybook/preview.tsx
CHANGED
|
@@ -4,19 +4,30 @@
|
|
|
4
4
|
import type { Preview } from '@storybook/react';
|
|
5
5
|
import { CratisComponentsProvider } from '@cratis/components/Common';
|
|
6
6
|
|
|
7
|
-
// The stylesheet layers a page in this blueprint needs, in the order they resolve. PrimeReact
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
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'`.
|
|
11
|
+
//
|
|
12
|
+
// `tokens` defines the `--cratis-*` layer, `styles` is every component stylesheet plus the Tailwind
|
|
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.
|
|
19
|
+
//
|
|
20
|
+
// The Scene package's bridge puts Scene's `--scene-*` tokens in front of that, and the default blueprint's
|
|
11
21
|
// `layout.css` draws the shell every one of these pages sits inside - which is the sheet this package does
|
|
12
22
|
// not have and does not want, because the shell is not its.
|
|
13
23
|
//
|
|
14
24
|
// The last two are reached by relative path rather than through their packages' `./styles` export,
|
|
15
25
|
// because `main.ts` aliases those package names to their sources and a Vite string alias matches by
|
|
16
26
|
// prefix - `@cratis/scene.components/styles` would be rewritten into a path inside `index.ts`.
|
|
17
|
-
import '
|
|
18
|
-
import 'primeicons/primeicons.css';
|
|
27
|
+
import '@cratis/components/tokens';
|
|
19
28
|
import '@cratis/components/styles';
|
|
29
|
+
import '@cratis/components/theme';
|
|
30
|
+
import 'primeicons/primeicons.css';
|
|
20
31
|
import '../../components/theme/sceneTokenBridge.css';
|
|
21
32
|
import '../../blueprint.default/shell/layout.css';
|
|
22
33
|
|
|
@@ -25,6 +36,12 @@ import '../../blueprint.default/shell/layout.css';
|
|
|
25
36
|
* PrimeReact's. Without it the wrapped components fall back to PrimeReact's defaults rather than Cratis',
|
|
26
37
|
* so a story would show something subtly different from what an application renders - which defeats the
|
|
27
38
|
* point of having stories at all.
|
|
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.
|
|
28
45
|
*/
|
|
29
46
|
const preview: Preview = {
|
|
30
47
|
decorators: [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
3
4
|
import { SceneElementView } from '@cratis/scene.react';
|
|
4
5
|
import { clearBindings, registerQuery } from '@cratis/scene.components';
|
|
5
6
|
import { composeScreenElement, resolveElementComponentNames } from '@cratis/scene.blueprint.default';
|
|
@@ -8,7 +9,7 @@ import { SampleBindingName, arcPageHeader } from '../templates';
|
|
|
8
9
|
class AllInvoices {
|
|
9
10
|
}
|
|
10
11
|
function renderElement(element) {
|
|
11
|
-
render(_jsx(SceneElementView, { element: resolveElementComponentNames(element, componentsBlueprintProfile, componentsBlueprintCatalog), registry: componentsPreviewRegistry, resolveBinding: () => undefined }));
|
|
12
|
+
render(_jsx(PrimeReactProvider, { children: _jsx(SceneElementView, { element: resolveElementComponentNames(element, componentsBlueprintProfile, componentsBlueprintCatalog), registry: componentsPreviewRegistry, resolveBinding: () => undefined }) }));
|
|
12
13
|
}
|
|
13
14
|
function has(selector) {
|
|
14
15
|
return document.querySelector(selector) !== null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"when_rendering_a_gallery_screen.js","sourceRoot":"","sources":["../../../for_ArcPageHeader/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"when_rendering_a_gallery_screen.js","sourceRoot":"","sources":["../../../for_ArcPageHeader/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AACrG,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACxI,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW;CAAG;AAMpB,SAAS,aAAa,CAAC,OAAqB;IACxC,MAAM,CACF,KAAC,kBAAkB,cACf,KAAC,gBAAgB,IACb,OAAO,EAAE,4BAA4B,CAAC,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,CAAC,EACtG,QAAQ,EAAE,yBAAyB,EACnC,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS,GACjC,GACe,CACxB,CAAC;AACN,CAAC;AAED,SAAS,GAAG,CAAC,QAAgB;IACzB,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC7C,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACvC,UAAU,CAAC,GAAG,EAAE;YAC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CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAClD,UAAU,CAAC,GAAG,EAAE;YACZ,aAAa,EAAE,CAAC;YAChB,aAAa,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAC1D,aAAa,CAAC,aAAa,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAClI,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;QAEjC,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;YACjE,MAAM,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wFAAwF,EAAE,GAAG,EAAE;YAC9F,GAAG,CAAC,oCAAoC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"when_resolving_its_dependencies.js","sourceRoot":"","sources":["../../../for_componentsBlueprint/when_resolving_its_dependencies.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,MAAM,QAAQ,GAAiB;IAC3B,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,WAAW,CAAC,OAAO;IACzB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,EAAE;IACX,eAAe,EAAE,EAAE;IACnB,eAAe,EAAE,EAAE;IACnB,MAAM,EAAE,EAAE;CACb,CAAC;
|
|
1
|
+
{"version":3,"file":"when_resolving_its_dependencies.js","sourceRoot":"","sources":["../../../for_componentsBlueprint/when_resolving_its_dependencies.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,MAAM,QAAQ,GAAiB;IAC3B,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,WAAW,CAAC,OAAO;IACzB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,EAAE;IACX,eAAe,EAAE,EAAE;IACnB,eAAe,EAAE,EAAE;IACnB,MAAM,EAAE,EAAE;CACb,CAAC;AAWF,MAAM,UAAU,GAAiB;IAC7B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,WAAW,CAAC,gBAAgB;IAClC,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACpC,UAAU,EAAE,CAAC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