@diagrammo/dgmo 0.40.0 → 0.41.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/dist/auto.mjs CHANGED
@@ -15115,6 +15115,8 @@ function parseEventLine(content, palette) {
15115
15115
  let currentTagGroup = null;
15116
15116
  let currentEvent = null;
15117
15117
  let currentEra = null;
15118
+ let eraIndent = -1;
15119
+ let currentEventIndent = 0;
15118
15120
  const aliasMap = /* @__PURE__ */ new Map();
15119
15121
  for (let i = 0; i < lines.length; i++) {
15120
15122
  const line11 = lines[i];
@@ -15189,52 +15191,15 @@ function parseEventLine(content, palette) {
15189
15191
  });
15190
15192
  continue;
15191
15193
  }
15192
- if (indent > 0) {
15193
- if (!currentEvent) {
15194
- pushWarning(
15195
- lineNumber,
15196
- `Indented description "${trimmed}" has no event above it \u2014 add an event line first. (\xA728)`
15197
- );
15198
- continue;
15199
- }
15194
+ if (currentEvent && indent > currentEventIndent) {
15200
15195
  const descLine = trimmed.startsWith("- ") ? `\u2022 ${trimmed.substring(2)}` : trimmed;
15201
15196
  currentEvent.description.push(descLine);
15202
15197
  continue;
15203
15198
  }
15204
- currentTagGroup = null;
15205
- if (trimmed.toLowerCase() === "no-scale") {
15206
- options.scale = false;
15207
- continue;
15208
- }
15209
- const sideMatch = trimmed.match(SIDE_RE);
15210
- if (sideMatch) {
15211
- options.side = sideMatch[1].toLowerCase();
15212
- continue;
15213
- }
15214
- if (trimmed.toLowerCase() === "no-box") {
15215
- options.noBox = true;
15216
- continue;
15217
- }
15218
- if (trimmed.toLowerCase() === "no-legend") {
15219
- options.noLegend = true;
15220
- continue;
15221
- }
15222
- const dirMatch = trimmed.match(DIRECTION_RE);
15223
- if (dirMatch) {
15224
- const dir = dirMatch[1].toUpperCase();
15225
- if (dir !== "LR") {
15226
- pushWarning(
15227
- lineNumber,
15228
- `event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
15229
- EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
15230
- );
15231
- }
15232
- continue;
15233
- }
15234
- if (tryParseSharedOption(trimmed, sharedOptions)) continue;
15235
15199
  const eraMatch = trimmed.match(ERA_RE);
15236
15200
  if (eraMatch) {
15237
15201
  contentStarted = true;
15202
+ currentTagGroup = null;
15238
15203
  currentEvent = null;
15239
15204
  const name = eraMatch[1].trim();
15240
15205
  let rest = (eraMatch[2] ?? "").trim();
@@ -15258,16 +15223,52 @@ function parseEventLine(content, palette) {
15258
15223
  const era = { name, color, collapsed, lineNumber };
15259
15224
  result.eras.push(era);
15260
15225
  currentEra = name;
15226
+ eraIndent = indent;
15261
15227
  continue;
15262
15228
  }
15263
- if (SECTION_SEAM_RE.test(trimmed)) {
15264
- pushWarning(
15265
- lineNumber,
15266
- "Group events with `[Name]` era brackets (\xA728.6a), not `section`.",
15267
- EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
15268
- );
15269
- continue;
15229
+ if (indent === 0) {
15230
+ currentTagGroup = null;
15231
+ if (trimmed.toLowerCase() === "no-scale") {
15232
+ options.scale = false;
15233
+ continue;
15234
+ }
15235
+ const sideMatch = trimmed.match(SIDE_RE);
15236
+ if (sideMatch) {
15237
+ options.side = sideMatch[1].toLowerCase();
15238
+ continue;
15239
+ }
15240
+ if (trimmed.toLowerCase() === "no-box") {
15241
+ options.noBox = true;
15242
+ continue;
15243
+ }
15244
+ if (trimmed.toLowerCase() === "no-legend") {
15245
+ options.noLegend = true;
15246
+ continue;
15247
+ }
15248
+ const dirMatch = trimmed.match(DIRECTION_RE);
15249
+ if (dirMatch) {
15250
+ const dir = dirMatch[1].toUpperCase();
15251
+ if (dir !== "LR") {
15252
+ pushWarning(
15253
+ lineNumber,
15254
+ `event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
15255
+ EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
15256
+ );
15257
+ }
15258
+ continue;
15259
+ }
15260
+ if (tryParseSharedOption(trimmed, sharedOptions)) continue;
15261
+ if (SECTION_SEAM_RE.test(trimmed)) {
15262
+ pushWarning(
15263
+ lineNumber,
15264
+ "Group events with `[Name]` era brackets (\xA728.6a), not `section`.",
15265
+ EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
15266
+ );
15267
+ continue;
15268
+ }
15270
15269
  }
15270
+ const inEra = currentEra !== null && indent > eraIndent;
15271
+ if (!inEra) currentEra = null;
15271
15272
  contentStarted = true;
15272
15273
  const event = parseEventHeader(
15273
15274
  trimmed,
@@ -15279,6 +15280,7 @@ function parseEventLine(content, palette) {
15279
15280
  );
15280
15281
  result.events.push(event);
15281
15282
  currentEvent = event;
15283
+ currentEventIndent = indent;
15282
15284
  }
15283
15285
  options.noTitle = sharedOptions["no-title"] === "on";
15284
15286
  finalizeAutoTagColors(result.tagGroups, palette);
@@ -69244,7 +69246,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
69244
69246
 
69245
69247
  // src/auto/index.ts
69246
69248
  init_safe_href();
69247
- var VERSION = "0.40.0";
69249
+ var VERSION = "0.41.0";
69248
69250
  var DEFAULTS = {
69249
69251
  theme: "auto",
69250
69252
  palette: "slate",