comark-code-notes 0.9.1 → 0.10.1
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/dist/{client-yoHWy92u.mjs → client-BuJEtZ1_.mjs} +1 -1
- package/dist/client.mjs +2 -2
- package/dist/html.mjs +2 -2
- package/dist/react.d.mts +1 -0
- package/dist/react.mjs +2 -1
- package/dist/style.css +1 -1
- package/dist/{styles-Cu6U60wa.mjs → styles-CgK7JPIz.mjs} +5 -3
- package/dist/svelte/CodeNotes.svelte +1 -1
- package/dist/vue.mjs +2 -1
- package/package.json +8 -8
package/dist/client.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as css } from "./styles-
|
|
2
|
-
import { t as addStyles } from "./client-
|
|
1
|
+
import { t as css } from "./styles-CgK7JPIz.mjs";
|
|
2
|
+
import { t as addStyles } from "./client-BuJEtZ1_.mjs";
|
|
3
3
|
export { addStyles, css };
|
package/dist/html.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as src_default, t as NOTES_TAG } from "./src-JYXNZqY7.mjs";
|
|
2
|
-
import { t as css } from "./styles-
|
|
2
|
+
import { t as css } from "./styles-CgK7JPIz.mjs";
|
|
3
3
|
//#region src/html.ts
|
|
4
4
|
const styled = /* @__PURE__ */ new WeakSet();
|
|
5
5
|
const notes = async ([, attrs, ...children], state) => {
|
|
6
6
|
const styles = styled.has(state.context) ? "" : `<style data-comark-code-notes>${css}</style>`;
|
|
7
7
|
styled.add(state.context);
|
|
8
8
|
const start = Number(attrs.start);
|
|
9
|
-
return `${styles}<ol class="cn-notes"${Number.isInteger(start) && start !== 1 ? ` start="${start}"` : ""}>${await state.flow([
|
|
9
|
+
return `${styles}<ol class="cn-notes" data-comark-frame${Number.isInteger(start) && start !== 1 ? ` start="${start}"` : ""}>${await state.flow([
|
|
10
10
|
"div",
|
|
11
11
|
{},
|
|
12
12
|
...children
|
package/dist/react.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ export declare function CodeNotes({ start, children }: CodeNotesAttributes & {
|
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
}): import("react").DetailedReactHTMLElement<{
|
|
8
8
|
className: string;
|
|
9
|
+
"data-comark-frame": string;
|
|
9
10
|
start: number | undefined;
|
|
10
11
|
}, HTMLElement>;
|
|
11
12
|
/** Pass these as `components` to `@comark/react`. */
|
package/dist/react.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as src_default, t as NOTES_TAG } from "./src-JYXNZqY7.mjs";
|
|
2
|
-
import { t as addStyles } from "./client-
|
|
2
|
+
import { t as addStyles } from "./client-BuJEtZ1_.mjs";
|
|
3
3
|
import { createElement, useEffect } from "react";
|
|
4
4
|
//#region src/react.ts
|
|
5
5
|
/** The notes under an annotated fence, for `@comark/react`. */
|
|
@@ -7,6 +7,7 @@ function CodeNotes({ start, children }) {
|
|
|
7
7
|
useEffect(addStyles, []);
|
|
8
8
|
return createElement("ol", {
|
|
9
9
|
className: "cn-notes",
|
|
10
|
+
"data-comark-frame": "",
|
|
10
11
|
start: start && start !== 1 ? start : void 0
|
|
11
12
|
}, children);
|
|
12
13
|
}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comark{:where(.cn-marker,.cn-notes){--_comark-background:var(--comark-background,var(--ui-bg,var(--background,#fff)));--_comark-foreground:var(--comark-foreground,var(--ui-text-highlighted,var(--foreground,#0a0a0a)));--_comark-muted:var(--comark-muted,var(--ui-text-muted,var(--muted-foreground,#737373)));--_comark-border:var(--comark-border,var(--ui-border,var(--border,#e5e5e5)));--_comark-accent:var(--comark-accent,var(--ui-bg-elevated,var(--accent,#f5f5f5)));--_comark-ring:var(--comark-ring,var(--ui-primary,var(--ring,#a1a1a1)));--_comark-primary:var(--comark-primary,var(--ui-primary,var(--primary,var(--_comark-foreground))));--_comark-primary-foreground:var(--comark-primary-foreground,var(--ui-text-inverted,var(--primary-foreground,var(--_comark-background))));--_comark-secondary:var(--comark-secondary,var(--ui-secondary,var(--_comark-muted)));--_comark-radius:var(--comark-radius,calc(var(--ui-radius,
|
|
1
|
+
@layer comark{:where(.cn-marker,.cn-notes){--_comark-background:var(--comark-background,var(--ui-bg,var(--background,#fff)));--_comark-foreground:var(--comark-foreground,var(--ui-text-highlighted,var(--foreground,#0a0a0a)));--_comark-muted:var(--comark-muted,var(--ui-text-muted,var(--muted-foreground,#737373)));--_comark-border:var(--comark-border,var(--ui-border,var(--border,#e5e5e5)));--_comark-accent:var(--comark-accent,var(--ui-bg-elevated,var(--accent,#f5f5f5)));--_comark-ring:var(--comark-ring,var(--ui-primary,var(--ring,#a1a1a1)));--_comark-primary:var(--comark-primary,var(--ui-primary,var(--primary,var(--_comark-foreground))));--_comark-primary-foreground:var(--comark-primary-foreground,var(--ui-text-inverted,var(--primary-foreground,var(--_comark-background))));--_comark-secondary:var(--comark-secondary,var(--ui-secondary,var(--_comark-muted)));--_comark-radius:var(--comark-radius,calc(var(--ui-radius,var(--radius,.625rem)/2)*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){:where(:not(.light,.light *)):is(:where(.cn-marker,.cn-notes)){--_comark-background:var(--comark-background,var(--ui-bg,var(--background,#0a0a0a)));--_comark-foreground:var(--comark-foreground,var(--ui-text-highlighted,var(--foreground,#fafafa)));--_comark-muted:var(--comark-muted,var(--ui-text-muted,var(--muted-foreground,#a1a1a1)));--_comark-border:var(--comark-border,var(--ui-border,var(--border,rgb(255 255 255/.1))));--_comark-accent:var(--comark-accent,var(--ui-bg-elevated,var(--accent,#262626)));--_comark-ring:var(--comark-ring,var(--ui-primary,var(--ring,#737373)));--_comark-primary:var(--comark-primary,var(--ui-primary,var(--primary,var(--_comark-foreground))));--_comark-primary-foreground:var(--comark-primary-foreground,var(--ui-text-inverted,var(--primary-foreground,var(--_comark-background))));--_comark-secondary:var(--comark-secondary,var(--ui-secondary,var(--_comark-muted)))}}:where(.dark,.dark *):is(:where(.cn-marker,.cn-notes)){--_comark-background:var(--comark-background,var(--ui-bg,var(--background,#0a0a0a)));--_comark-foreground:var(--comark-foreground,var(--ui-text-highlighted,var(--foreground,#fafafa)));--_comark-muted:var(--comark-muted,var(--ui-text-muted,var(--muted-foreground,#a1a1a1)));--_comark-border:var(--comark-border,var(--ui-border,var(--border,rgb(255 255 255/.1))));--_comark-accent:var(--comark-accent,var(--ui-bg-elevated,var(--accent,#262626)));--_comark-ring:var(--comark-ring,var(--ui-primary,var(--ring,#737373)));--_comark-primary:var(--comark-primary,var(--ui-primary,var(--primary,var(--_comark-foreground))));--_comark-primary-foreground:var(--comark-primary-foreground,var(--ui-text-inverted,var(--primary-foreground,var(--_comark-background))));--_comark-secondary:var(--comark-secondary,var(--ui-secondary,var(--_comark-muted)))}:where(.cn-marker){--cn-marker:var(--_comark-primary);--cn-marker-text:var(--cn-marker)}.cn-marker{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:1.25rem;height:1.25rem;margin-inline-start:.5rem;padding:0 .3rem;border-radius:9999px;background:color-mix(in srgb,var(--cn-marker) 10%,var(--_comark-background));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--cn-marker) 22%,transparent);font:600 .6875rem/1 var(--_comark-font);font-variant-numeric:tabular-nums;vertical-align:.0625rem;user-select:none;transition:background-color .15s}.cn-marker{color:var(--cn-marker-text)!important;text-decoration:none!important;border:0!important}.cn-marker::after{content:attr(data-note)}a.cn-marker:hover{background:color-mix(in srgb,var(--cn-marker) 18%,var(--_comark-background))}a.cn-marker:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--_comark-ring) 50%,transparent)}.cn-marker:target{box-shadow:0 0 0 3px color-mix(in srgb,var(--_comark-ring) 60%,transparent)}.line:has(>.cn-marker:is(:target,:focus)){border-image:conic-gradient(color-mix(in srgb,var(--cn-marker,currentColor) 14%,transparent) 0 0) fill 0//.25em 100vw}.cn-notes{margin:.75rem 0 1.5rem}.cn-notes{padding:0!important;list-style:none!important}.cn-notes>li{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:baseline;gap:.625rem;margin:.375rem 0;padding:.125rem .375rem;border-radius:calc(var(--_comark-radius) - 4px)}.cn-notes>li>.cn-marker{margin:0}.cn-notes>li>div>:first-child{margin-top:0!important}.cn-notes>li>div>:last-child{margin-bottom:0!important}.cn-notes>li:target{background:var(--_comark-accent)}}
|
|
@@ -63,7 +63,7 @@ const groups = {
|
|
|
63
63
|
"warning",
|
|
64
64
|
"ui-warning",
|
|
65
65
|
"",
|
|
66
|
-
"#
|
|
66
|
+
"#d57506",
|
|
67
67
|
"#fbbf24"
|
|
68
68
|
],
|
|
69
69
|
info: [
|
|
@@ -120,7 +120,9 @@ function dark(selector, declarations) {
|
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Resolves the `--comark-*` tokens on `selector`, falling back to Nuxt UI's variables, then shadcn/ui's, then shadcn's
|
|
123
|
-
* neutral theme. Nuxt UI's corners are twice its `--ui-radius`, so the radius halves shadcn's to double it back.
|
|
123
|
+
* neutral theme. Nuxt UI's corners are twice its `--ui-radius`, so the radius halves shadcn's to double it back. The
|
|
124
|
+
* halving sits in the `var()` fallback without a `calc()` of its own, which reads the same once the fallback is
|
|
125
|
+
* substituted, because postcss-calc, which cssnano runs, can't parse a `calc()` there.
|
|
124
126
|
* They resolve on the component rather than `:root`, so a `--comark-*` set on any ancestor still inherits down.
|
|
125
127
|
* `:where()` keeps them at zero specificity. The neutral theme follows the system's color mode, and a `.light` or
|
|
126
128
|
* `.dark` class on the component or above it pins one (see `dark()`).
|
|
@@ -132,7 +134,7 @@ function dark(selector, declarations) {
|
|
|
132
134
|
function theme(selector, ...extras) {
|
|
133
135
|
const where = `:where(${selector})`;
|
|
134
136
|
const list = [...tokens, ...extras.flatMap((name) => groups[name])];
|
|
135
|
-
return `${where}{${resolve(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,
|
|
137
|
+
return `${where}{${resolve(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,var(--radius,.625rem)/2)*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}` + dark(where, resolve(list, 4));
|
|
136
138
|
}
|
|
137
139
|
//#endregion
|
|
138
140
|
//#region src/styles.ts
|
package/dist/vue.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as src_default, t as NOTES_TAG } from "./src-JYXNZqY7.mjs";
|
|
2
|
-
import { t as addStyles } from "./client-
|
|
2
|
+
import { t as addStyles } from "./client-BuJEtZ1_.mjs";
|
|
3
3
|
import { defineComponent, h, onMounted } from "vue";
|
|
4
4
|
//#region src/vue.ts
|
|
5
5
|
/** The notes under an annotated fence, for `@comark/vue`. */
|
|
@@ -11,6 +11,7 @@ const CodeNotes = defineComponent({
|
|
|
11
11
|
onMounted(addStyles);
|
|
12
12
|
return () => h("ol", {
|
|
13
13
|
class: "cn-notes",
|
|
14
|
+
"data-comark-frame": "",
|
|
14
15
|
start: props.start && props.start !== 1 ? props.start : void 0
|
|
15
16
|
}, slots.default?.());
|
|
16
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comark-code-notes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Numbered notes on lines of code: a // <1> marker in a fence links to the numbered list after it. A Comark plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotations",
|
|
@@ -47,21 +47,21 @@
|
|
|
47
47
|
"provenance": true
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@comark/html": "^0.
|
|
51
|
-
"@comark/react": "^0.
|
|
52
|
-
"@comark/vue": "^0.
|
|
50
|
+
"@comark/html": "^0.9.0",
|
|
51
|
+
"@comark/react": "^0.9.0",
|
|
52
|
+
"@comark/vue": "^0.9.0",
|
|
53
53
|
"@types/react": "^19.3.0",
|
|
54
54
|
"@types/react-dom": "^19.3.0",
|
|
55
|
-
"comark": "^0.
|
|
55
|
+
"comark": "^0.9.0",
|
|
56
56
|
"react": "^19.3.1",
|
|
57
57
|
"react-dom": "^19.3.1",
|
|
58
58
|
"svelte": "^5.57.2",
|
|
59
59
|
"vue": "^3.5.44",
|
|
60
|
-
"comark-zoom": "0.
|
|
60
|
+
"comark-zoom": "0.10.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@comark/html": "^0.
|
|
64
|
-
"comark": "^0.
|
|
63
|
+
"@comark/html": "^0.9.0",
|
|
64
|
+
"comark": "^0.9.0",
|
|
65
65
|
"react": ">=18",
|
|
66
66
|
"svelte": ">=5",
|
|
67
67
|
"vue": ">=3.5"
|