@formicoidea/labre-framework-edgy 0.52.0 → 0.54.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.
@@ -1,4 +1,4 @@
1
- import { ElementRendererExtension, } from '@formicoidea/labre-core/blocks/surface';
1
+ import { ElementRendererExtension, notationColor, } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
3
3
  /** The shared notation scale's card: painted at render time, so every board. */
4
4
  const BOARD_FILL = NOTATION_NEUTRALS.cardFill;
@@ -11,7 +11,7 @@ const BOARD_BORDER_WIDTH = 2;
11
11
  * modelling and grant the spotlight-on-hover behavior to the elements laid on
12
12
  * top of it.
13
13
  */
14
- export const edgyBoard = (model, ctx, matrix) => {
14
+ export const edgyBoard = (model, ctx, matrix, renderer) => {
15
15
  const [, , w, h] = model.deserializedXYWH;
16
16
  const cx = w / 2;
17
17
  const cy = h / 2;
@@ -21,9 +21,9 @@ export const edgyBoard = (model, ctx, matrix) => {
21
21
  .translateSelf(-cx, -cy));
22
22
  ctx.beginPath();
23
23
  ctx.roundRect(0, 0, w, h, BOARD_RADIUS);
24
- ctx.fillStyle = BOARD_FILL;
24
+ ctx.fillStyle = notationColor(renderer, BOARD_FILL, 'fill');
25
25
  ctx.fill();
26
- ctx.strokeStyle = BOARD_BORDER;
26
+ ctx.strokeStyle = notationColor(renderer, BOARD_BORDER);
27
27
  ctx.lineWidth = BOARD_BORDER_WIDTH;
28
28
  ctx.stroke();
29
29
  };
@@ -0,0 +1,9 @@
1
+ import type { NotationDarkPalette } from '@formicoidea/labre-core/blocks/surface';
2
+ /**
3
+ * EDGY on a dark canvas (ADR 0039): the facet hues, and the facets' white
4
+ * centre, separators and pictograms, are the standard and stay exactly as
5
+ * drawn. Only the stencil ink, a near-black that would vanish on the dark
6
+ * card, turns into the shared light ink. The Architecture blue is kept though
7
+ * it reads at 2.9:1 on the dark card: it is the standard's.
8
+ */
9
+ export declare const EDGY_DARK_PALETTE: NotationDarkPalette;
@@ -0,0 +1,14 @@
1
+ import { COLORS } from './consts.js';
2
+ import { NODE_STROKE } from './node/consts.js';
3
+ /**
4
+ * EDGY on a dark canvas (ADR 0039): the facet hues, and the facets' white
5
+ * centre, separators and pictograms, are the standard and stay exactly as
6
+ * drawn. Only the stencil ink, a near-black that would vanish on the dark
7
+ * card, turns into the shared light ink. The Architecture blue is kept though
8
+ * it reads at 2.9:1 on the dark card: it is the standard's.
9
+ */
10
+ export const EDGY_DARK_PALETTE = {
11
+ framework: 'edgy',
12
+ colors: { [NODE_STROKE]: '#eaeaea' },
13
+ kept: [COLORS.architecture],
14
+ };
package/dist/view.js CHANGED
@@ -1,4 +1,4 @@
1
- import { QualityNudgeExtension, ReadingProfileExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
1
+ import { QualityNudgeExtension, ReadingProfileExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, NotationDarkPaletteExtension, } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { FrameworkPaletteExtension } from '@formicoidea/labre-core/components/color-picker';
3
3
  import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
4
4
  import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
@@ -22,6 +22,7 @@ import { EdgyNodeView } from './node/node-view.js';
22
22
  import { edgyBoardToolbarExtension, edgyBoardToolingToolbarExtension, edgyToolbarExtension, edgyToolingToolbarExtension, } from './toolbar/config.js';
23
23
  import { EDGY_FRAMEWORK_PALETTE, edgyNodeToolbarExtension, } from './toolbar/node-config.js';
24
24
  import { edgySeniorTool } from './toolbar/senior-tool.js';
25
+ import { EDGY_DARK_PALETTE } from './dark-palette.js';
25
26
  /**
26
27
  * EDGY rendering — ALWAYS registered, independent of any flag. Disabling `edgy`
27
28
  * hides only the creation tooling (see {@link EdgyViewExtension}); boards and
@@ -36,6 +37,7 @@ export class EdgyRenderViewExtension extends ViewExtensionProvider {
36
37
  }
37
38
  setup(context) {
38
39
  super.setup(context);
40
+ context.register(NotationDarkPaletteExtension(EDGY_DARK_PALETTE));
39
41
  context.register(EdgyView);
40
42
  context.register(EdgyFacetsRendererExtension);
41
43
  context.register(EdgyBoardView);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-edgy",
3
3
  "description": "Labre edgy framework for @formicoidea/labre-core.",
4
- "version": "0.52.0",
4
+ "version": "0.54.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -31,7 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@formicoidea/labre-core": "0.52.0",
34
+ "@formicoidea/labre-core": "0.54.0",
35
35
  "@preact/signals-core": "^1.8.0",
36
36
  "lit": "^3.2.0",
37
37
  "yjs": "^13.6.21"