@schukai/monster 5.0.1 → 5.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## [5.1.0] - 2026-10-11
6
+
7
+ ### Add Features
8
+
9
+ - **style:** add composable content surfaces ([#598](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/598))
10
+
11
+
12
+
5
13
  ## [5.0.1] - 2026-10-11
6
14
 
7
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","exports":{".":"./source/monster.mjs","./CHANGELOG.md":"./CHANGELOG.md","./LICENSE":"./LICENSE","./README.md":"./README.md","./documentation/migrations/monster-5-options.md":"./documentation/migrations/monster-5-options.md","./package.json":"./package.json","./source/*":"./source/*","./test/*":"./test/*"},"files":["source","test/cases","test/util","documentation/migrations/monster-5-options.md","CHANGELOG.md"],"homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"sideEffects":["./source/monster.mjs","./source/components/**","./source/i18n/**","./test/**"],"type":"module","version":"5.0.1"}
1
+ {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","exports":{".":"./source/monster.mjs","./CHANGELOG.md":"./CHANGELOG.md","./LICENSE":"./LICENSE","./README.md":"./README.md","./documentation/migrations/monster-5-options.md":"./documentation/migrations/monster-5-options.md","./package.json":"./package.json","./source/*":"./source/*","./test/*":"./test/*"},"files":["source","test/cases","test/util","documentation/migrations/monster-5-options.md","CHANGELOG.md"],"homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"sideEffects":["./source/monster.mjs","./source/components/**","./source/i18n/**","./test/**"],"type":"module","version":"5.1.0"}
@@ -0,0 +1,2 @@
1
+ /** generated from surface.pcss **/
2
+ :where(.monster-surface){box-sizing:border-box;min-inline-size:0;display:grid;gap:var(--monster-surface-gap,var(--monster-space-3));padding:var(--monster-surface-padding,var(--monster-space-5));border-width:var(--monster-border-width);border-style:var(--monster-border-style);border-color:var(--monster-color-border-1);border-radius:var(--monster-border-radius);box-shadow:var(--monster-box-shadow-1)}.monster-surface-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--monster-surface-grid-min-inline-size,20rem)),1fr));gap:var(--monster-surface-grid-gap,var(--monster-space-5));align-items:stretch}.monster-surface-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--monster-surface-actions-gap,var(--monster-space-3));margin-block-start:auto}
@@ -0,0 +1,33 @@
1
+ :where(.monster-surface) {
2
+ box-sizing: border-box;
3
+ min-inline-size: 0;
4
+ display: grid;
5
+ gap: var(--monster-surface-gap, var(--monster-space-3));
6
+ padding: var(--monster-surface-padding, var(--monster-space-5));
7
+ border-width: var(--monster-border-width);
8
+ border-style: var(--monster-border-style);
9
+ border-color: var(--monster-color-border-1);
10
+ border-radius: var(--monster-border-radius);
11
+ box-shadow: var(--monster-box-shadow-1);
12
+ }
13
+
14
+ .monster-surface-grid {
15
+ display: grid;
16
+ grid-template-columns: repeat(
17
+ auto-fit,
18
+ minmax(
19
+ min(100%, var(--monster-surface-grid-min-inline-size, 20rem)),
20
+ 1fr
21
+ )
22
+ );
23
+ gap: var(--monster-surface-grid-gap, var(--monster-space-5));
24
+ align-items: stretch;
25
+ }
26
+
27
+ .monster-surface-actions {
28
+ display: flex;
29
+ flex-wrap: wrap;
30
+ align-items: center;
31
+ gap: var(--monster-surface-actions-gap, var(--monster-space-3));
32
+ margin-block-start: auto;
33
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright © Volker Schukai and all contributing authors, 2026. All rights reserved.
3
+ * Node module: @schukai/monster
4
+ *
5
+ * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
6
+ * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
7
+ *
8
+ * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
9
+ * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
10
+ * For more information about purchasing a commercial license, please contact Volker Schukai.
11
+ */
12
+
13
+ import { addAttributeToken } from "../../dom/attributes.mjs";
14
+ import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";
15
+
16
+ export { SurfaceStyleSheet };
17
+
18
+ /**
19
+ * @private
20
+ * @type {CSSStyleSheet}
21
+ */
22
+ const SurfaceStyleSheet = new CSSStyleSheet();
23
+
24
+ try {
25
+ SurfaceStyleSheet.insertRule(
26
+ `
27
+ @layer surface {
28
+ :where(.monster-surface){box-sizing:border-box;min-inline-size:0;display:grid;gap:var(--monster-surface-gap,var(--monster-space-3));padding:var(--monster-surface-padding,var(--monster-space-5));border-width:var(--monster-border-width);border-style:var(--monster-border-style);border-color:var(--monster-color-border-1);border-radius:var(--monster-border-radius);box-shadow:var(--monster-box-shadow-1)}.monster-surface-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--monster-surface-grid-min-inline-size,20rem)),1fr));gap:var(--monster-surface-grid-gap,var(--monster-space-5));align-items:stretch}.monster-surface-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--monster-surface-actions-gap,var(--monster-space-3));margin-block-start:auto}
29
+ }`,
30
+ 0,
31
+ );
32
+ } catch (e) {
33
+ addAttributeToken(
34
+ document.getRootNode().querySelector("html"),
35
+ ATTRIBUTE_ERRORMESSAGE,
36
+ e + "",
37
+ );
38
+ }
@@ -156,7 +156,7 @@ function getMonsterVersion() {
156
156
  }
157
157
 
158
158
  /** Managed by the release script; keep synchronized with package.json. */
159
- monsterVersion = new Version("5.0.1");
159
+ monsterVersion = new Version("5.1.0");
160
160
 
161
161
  return monsterVersion;
162
162
  }
@@ -0,0 +1,50 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { expect } from "chai";
3
+
4
+ const source = readFileSync(
5
+ new URL("../../../../source/components/style/surface.pcss", import.meta.url),
6
+ "utf8",
7
+ );
8
+ const generatedStyleSheet = readFileSync(
9
+ new URL(
10
+ "../../../../source/components/stylesheet/surface.mjs",
11
+ import.meta.url,
12
+ ),
13
+ "utf8",
14
+ );
15
+
16
+ describe("Content surfaces", () => {
17
+ it("provides theme-composable static content geometry", () => {
18
+ expect(source).to.include(":where(.monster-surface)");
19
+ expect(source).to.include(
20
+ "gap: var(--monster-surface-gap, var(--monster-space-3));",
21
+ );
22
+ expect(source).to.include(
23
+ "padding: var(--monster-surface-padding, var(--monster-space-5));",
24
+ );
25
+ expect(source).to.include("border-width: var(--monster-border-width);");
26
+ expect(source).to.include("border-style: var(--monster-border-style);");
27
+ expect(source).to.include("border-color: var(--monster-color-border-1);");
28
+ expect(source).to.include("border-radius: var(--monster-border-radius);");
29
+ expect(source).not.to.match(/^\s*(?:background-color|color):/mu);
30
+ });
31
+
32
+ it("provides reusable responsive grids and action rows", () => {
33
+ expect(source).to.include(".monster-surface-grid");
34
+ expect(source).to.include("grid-template-columns: repeat(");
35
+ expect(source).to.include("auto-fit,");
36
+ expect(source).to.include(".monster-surface-actions");
37
+ expect(source).to.include("margin-block-start: auto;");
38
+ });
39
+
40
+ it("keeps the generated stylesheet synchronized", () => {
41
+ expect(generatedStyleSheet).to.include(":where(.monster-surface)");
42
+ expect(generatedStyleSheet).to.include(
43
+ "gap:var(--monster-surface-gap,var(--monster-space-3))",
44
+ );
45
+ expect(generatedStyleSheet).to.include(
46
+ "grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--monster-surface-grid-min-inline-size,20rem)),1fr))",
47
+ );
48
+ expect(generatedStyleSheet).to.include(".monster-surface-actions");
49
+ });
50
+ });