concept-atlas-dense-explain 0.3.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "concept-atlas-dense-explain",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Portable dense-explanation skill and MDX concept atlas template",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -9,17 +9,21 @@ Use the `concept-atlas-dense-explain` npm CLI. This skill is intentionally light
9
9
 
10
10
  ## Workflow
11
11
 
12
- 1. Choose the carrier before writing any MDX. A (continuous reading) uses a document-flow MDX structure; B (interactive Concept Atlas) uses a concept-graph MDX structure. Recommend B when the reader needs concept navigation or a relation graph; recommend A for a conventional HTML reading flow with denser horizontal component grids.
12
+ 1. Choose the page shell before writing MDX. `atlas` uses a concept graph with node navigation; `scroll` uses a continuous document flow. The component library is shared: information-density components such as `Insight`, `Flow`, `FrameworkModel`, `MatrixModel`, `Mermaid`, `RelationMap`, `NoteGrid`, `Callout`, `Details`, `Columns`, `Grid`, `Stack`, and `Tabs` can be used wherever their meaning fits. Recommend `atlas` when the reader needs concept navigation or a relation graph; recommend `scroll` for a conventional reading flow.
13
13
  2. When a starting point is useful, create a single MDX file with `npx concept-atlas-dense-explain create <file>.mdx --mode atlas|scroll`, then rewrite it with the AI.
14
14
  3. For B, write semantic MDX to the user-selected `.mdx` file. Include one `L0`, multiple `L1` branches, useful depth, `Children`/`ConceptRef`, and labeled `Relation`s. This content renders through the interactive atlas entry.
15
- 4. For A, write semantic MDX to the user-selected `.mdx` file with `ScrollDocument`, `ScrollHeader`, `ScrollSection`, `ScrollProse`, and `ScrollGrid`. Do not wrap it in `ExplainPage`, `ConceptGraph`, or `ConceptNode`. This content renders through the continuous-reader entry.
16
- 5. Do not try to make one MDX file serve both carriers. The template ships both sample entries for reference, but they represent distinct authoring formats.
17
- 6. Compile directly with `npx concept-atlas-dense-explain <file>.mdx --mode atlas|scroll`. The output is a standalone `.html` beside the MDX unless `-o` is provided. The mode can be detected from the top-level carrier, but specify it when the file is ambiguous.
18
- 7. Report the selected mode, output path, and limitations. Do not claim interactions that were not verified.
15
+ 4. For `scroll`, use `ScrollDocument`, `ScrollHeader`, `ScrollSection`, `ScrollProse`, and `ScrollGrid` as the document shell. Put shared information components inside sections as needed.
16
+ 5. For `atlas`, use `ExplainPage`, `ConceptGraph`, `ConceptNode`, `Children`, `ConceptRef`, and `Relation` as the graph shell. Put shared information components inside nodes as needed.
17
+ 6. Do not force one MDX file to be both page shells. This is a shell distinction, not a component-library distinction; convert only the outer structure when changing carriers.
18
+ 7. Compile directly with `npx concept-atlas-dense-explain <file>.mdx --mode atlas|scroll`. The output is a standalone `.html` beside the MDX unless `-o` is provided. The mode can be detected from the top-level carrier, but specify it when the file is ambiguous.
19
+ 8. Report the selected mode, output path, and limitations. Do not claim interactions that were not verified.
19
20
 
20
21
  ## Content rules
21
22
 
22
23
  - Keep MDX semantic; do not write CSS, coordinates, SVG, or replacement application code.
23
24
  - Give important nodes a claim-like title, a one-sentence summary, evidence, and meaningful components.
24
- - Use only components and relation types supported by the built-in renderer.
25
+ - Treat the built-in component library as shared across carriers; choose components by the relationship they express, not by the page shell.
26
+ - Keep the outer shell valid for the selected carrier and keep component props valid; the renderer does not convert arbitrary JSX or CSS into a semantic component automatically.
27
+ - For array props, use the documented object shapes: `Flow.steps` accepts strings or `{ title, description }`, `Timeline.events` uses `{ label, content }`, table rows use `string[][]`, and model data uses arrays of named objects.
28
+ - For continuous reading, configure spacing on the shell with `ScrollDocument spacing="compact|comfortable|airy"`; use `ScrollSection spacing="..."` only for a local override instead of adding manual margins.
25
29
  - If the CLI or npm registry is unavailable, report the blocker instead of copying the implementation into the skill.
@@ -194,16 +194,16 @@ export function DecisionMatrix({ title = '权衡矩阵', headers = [], rows = []
194
194
  }
195
195
  DecisionMatrix.displayName = 'DecisionMatrix';
196
196
 
197
- export function Flow({ steps = [], children }) {
198
- if (steps.length > 0) {
199
- return (
200
- <div className="semantic-flow-steps">
201
- {steps.map((step, idx) => (
202
- <div key={idx} className="flow-step">
203
- <span className="step-num">{idx + 1}</span>
204
- <span className="step-text">{step}</span>
205
- {idx < steps.length - 1 && <span className="step-arrow">→</span>}
206
- </div>
197
+ export function Flow({ steps = [], children }) {
198
+ if (steps.length > 0) {
199
+ return (
200
+ <div className="semantic-flow-steps">
201
+ {steps.map((step, idx) => (
202
+ <div key={idx} className="flow-step">
203
+ <span className="step-num">{idx + 1}</span>
204
+ <span className="step-text">{typeof step === 'object' ? <><strong>{step.title || step.label || `步骤 ${idx + 1}`}</strong>{step.description && <small>{step.description}</small>}</> : step}</span>
205
+ {idx < steps.length - 1 && <span className="step-arrow">→</span>}
206
+ </div>
207
207
  ))}
208
208
  </div>
209
209
  );
@@ -357,8 +357,9 @@ export function Columns({ children }) {
357
357
  }
358
358
  Columns.displayName = 'Columns';
359
359
 
360
- export function ScrollDocument({ children }) {
361
- return <article className="continuous-document">{children}</article>;
360
+ export function ScrollDocument({ spacing = 'comfortable', children }) {
361
+ const safeSpacing = ['compact', 'comfortable', 'airy'].includes(spacing) ? spacing : 'comfortable';
362
+ return <article className={`continuous-document continuous-spacing-${safeSpacing}`}>{children}</article>;
362
363
  }
363
364
  ScrollDocument.displayName = 'ScrollDocument';
364
365
 
@@ -367,9 +368,10 @@ export function ScrollHeader({ label = '连续阅读', title, children }) {
367
368
  }
368
369
  ScrollHeader.displayName = 'ScrollHeader';
369
370
 
370
- export function ScrollSection({ title, wide = false, children }) {
371
+ export function ScrollSection({ title, wide = false, spacing = 'inherit', children }) {
372
+ const safeSpacing = ['compact', 'comfortable', 'airy'].includes(spacing) ? ` continuous-spacing-${spacing}` : '';
371
373
  return (
372
- <section className={`continuous-section${wide ? ' continuous-section-wide' : ''}`}>
374
+ <section className={`continuous-section${wide ? ' continuous-section-wide' : ''}${safeSpacing}`}>
373
375
  {title && <h2>{title}</h2>}
374
376
  {children}
375
377
  </section>
@@ -2890,10 +2890,10 @@ button.flow-box {
2890
2890
  --annotation-accent: var(--text-accent);
2891
2891
  margin: 14px 0;
2892
2892
  padding: 10px 0 10px 14px;
2893
- border: 0;
2893
+ border: 1px solid var(--border-subtle);
2894
2894
  border-inline-start: 2px solid var(--annotation-accent);
2895
- border-radius: 0;
2896
- background: transparent;
2895
+ border-radius: var(--radius-2);
2896
+ background: var(--bg-surface);
2897
2897
  box-shadow: none;
2898
2898
  }
2899
2899
 
@@ -2986,8 +2986,14 @@ html[data-carrier='scroll'] #root {
2986
2986
  .continuous-document {
2987
2987
  width: min(1120px, 100%);
2988
2988
  margin: 0 auto;
2989
+ --scroll-block-gap: 18px;
2990
+ --scroll-grid-gap: 16px;
2989
2991
  }
2990
2992
 
2993
+ .continuous-spacing-compact { --scroll-block-gap: 10px; --scroll-grid-gap: 10px; }
2994
+ .continuous-spacing-comfortable { --scroll-block-gap: 18px; --scroll-grid-gap: 16px; }
2995
+ .continuous-spacing-airy { --scroll-block-gap: 28px; --scroll-grid-gap: 24px; }
2996
+
2991
2997
  .continuous-header {
2992
2998
  max-width: 820px;
2993
2999
  margin: 0 0 56px;
@@ -3019,11 +3025,19 @@ html[data-carrier='scroll'] #root {
3019
3025
  }
3020
3026
 
3021
3027
  .continuous-section {
3028
+ display: flex;
3029
+ flex-direction: column;
3030
+ gap: var(--scroll-block-gap);
3022
3031
  margin: 0 0 48px;
3023
3032
  padding: 0 0 48px;
3024
3033
  border-bottom: 1px solid var(--border-medium);
3025
3034
  }
3026
3035
 
3036
+ .continuous-section.continuous-spacing-compact { --scroll-block-gap: 10px; --scroll-grid-gap: 10px; }
3037
+ .continuous-section.continuous-spacing-comfortable { --scroll-block-gap: 18px; --scroll-grid-gap: 16px; }
3038
+ .continuous-section.continuous-spacing-airy { --scroll-block-gap: 28px; --scroll-grid-gap: 24px; }
3039
+ .continuous-section > * { margin-top: 0; margin-bottom: 0; }
3040
+
3027
3041
  .continuous-section > h2,
3028
3042
  .continuous-model-pair h2 {
3029
3043
  margin: 0 0 14px;
@@ -3044,7 +3058,7 @@ html[data-carrier='scroll'] #root {
3044
3058
 
3045
3059
  .continuous-grid {
3046
3060
  display: grid;
3047
- gap: 16px;
3061
+ gap: var(--scroll-grid-gap, 16px);
3048
3062
  align-items: stretch;
3049
3063
  }
3050
3064
 
@@ -3052,6 +3066,98 @@ html[data-carrier='scroll'] #root {
3052
3066
  .continuous-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
3053
3067
  .continuous-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
3054
3068
 
3069
+ .semantic-flow-steps {
3070
+ display: grid;
3071
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
3072
+ gap: 8px;
3073
+ margin: 14px 0;
3074
+ padding: 10px;
3075
+ border: 1px solid var(--border-medium);
3076
+ border-top: 2px solid var(--primary);
3077
+ border-radius: var(--radius-3);
3078
+ background: var(--bg-surface);
3079
+ }
3080
+
3081
+ .flow-step {
3082
+ position: relative;
3083
+ display: grid;
3084
+ grid-template-columns: auto 1fr;
3085
+ gap: 8px;
3086
+ align-items: start;
3087
+ min-width: 0;
3088
+ padding: 10px;
3089
+ border: 1px solid var(--border-subtle);
3090
+ border-radius: var(--radius-2);
3091
+ background: var(--bg-card);
3092
+ }
3093
+
3094
+ .step-num {
3095
+ display: grid;
3096
+ place-items: center;
3097
+ width: 22px;
3098
+ height: 22px;
3099
+ border-radius: 50%;
3100
+ background: var(--bg-highlight);
3101
+ color: var(--text-accent);
3102
+ font: 700 11px/1 ui-monospace, monospace;
3103
+ }
3104
+
3105
+ .step-text { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
3106
+ .step-text strong, .step-text small { display: block; }
3107
+ .step-text strong { color: var(--text-primary); font-size: 12px; }
3108
+ .step-text small { margin-top: 3px; color: var(--text-secondary); }
3109
+ .step-arrow { display: none; }
3110
+
3111
+ .semantic-overview,
3112
+ .semantic-definition,
3113
+ .semantic-mechanism,
3114
+ .semantic-prerequisite,
3115
+ .semantic-input,
3116
+ .semantic-output,
3117
+ .semantic-glossary-item,
3118
+ .semantic-example,
3119
+ .semantic-boundary,
3120
+ .semantic-counterexample {
3121
+ margin: 10px 0;
3122
+ padding: 10px 12px;
3123
+ border: 1px solid var(--border-medium);
3124
+ border-radius: var(--radius-2);
3125
+ background: var(--bg-surface);
3126
+ color: var(--text-secondary);
3127
+ }
3128
+
3129
+ .semantic-definition { border-top: 2px solid var(--border-strong); }
3130
+ .semantic-mechanism { background: color-mix(in srgb, var(--bg-surface) 82%, var(--bg-card)); }
3131
+ .semantic-example { background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border-subtle); }
3132
+ .semantic-boundary { border-style: dashed; }
3133
+ .semantic-counterexample { border-style: dotted; }
3134
+ .semantic-glossary-item { border-bottom-color: var(--border-strong); }
3135
+
3136
+ .semantic-stack:has(> .semantic-definition, > .semantic-mechanism, > .semantic-boundary) {
3137
+ margin: 14px 0;
3138
+ padding: 10px 16px;
3139
+ border: 1px solid var(--border-medium);
3140
+ border-radius: var(--radius-3);
3141
+ background: var(--bg-card);
3142
+ box-shadow: 2px 3px 0 rgba(15, 23, 42, 0.12);
3143
+ }
3144
+
3145
+ .semantic-stack:has(> .semantic-definition, > .semantic-mechanism, > .semantic-boundary) > .semantic-definition,
3146
+ .semantic-stack:has(> .semantic-definition, > .semantic-mechanism, > .semantic-boundary) > .semantic-mechanism,
3147
+ .semantic-stack:has(> .semantic-definition, > .semantic-mechanism, > .semantic-boundary) > .semantic-boundary {
3148
+ margin: 0;
3149
+ padding: 12px 0;
3150
+ border: 0;
3151
+ border-bottom: 1px solid var(--border-subtle);
3152
+ border-radius: 0;
3153
+ background: transparent;
3154
+ box-shadow: none;
3155
+ }
3156
+
3157
+ .semantic-stack:has(> .semantic-definition, > .semantic-mechanism, > .semantic-boundary) > :last-child {
3158
+ border-bottom: 0;
3159
+ }
3160
+
3055
3161
  .continuous-grid > .semantic-framework-model,
3056
3162
  .continuous-grid > .semantic-model-matrix,
3057
3163
  .continuous-grid > .semantic-model-formula,