@podlite/markdown 0.0.8 → 0.0.10

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/lib/index.esm.js CHANGED
@@ -6723,6 +6723,9 @@ var require_AstTree = __commonJS({
6723
6723
  {
6724
6724
  $ref: "#/definitions/BlockImage"
6725
6725
  },
6726
+ {
6727
+ $ref: "#/definitions/BlockPicture"
6728
+ },
6726
6729
  {
6727
6730
  $ref: "#/definitions/BlockCaption"
6728
6731
  },
@@ -7061,6 +7064,71 @@ var require_AstTree = __commonJS({
7061
7064
  "value"
7062
7065
  ]
7063
7066
  },
7067
+ BlockPicture: {
7068
+ type: "object",
7069
+ properties: {
7070
+ name: {
7071
+ type: "string",
7072
+ enum: [
7073
+ "picture"
7074
+ ]
7075
+ },
7076
+ caption: {
7077
+ type: "string"
7078
+ },
7079
+ link: {
7080
+ type: "string"
7081
+ },
7082
+ content: {
7083
+ type: "array",
7084
+ items: [
7085
+ {
7086
+ $ref: "#/definitions/Image"
7087
+ },
7088
+ {
7089
+ $ref: "#/definitions/BlockCaption"
7090
+ }
7091
+ ],
7092
+ minItems: 2,
7093
+ maxItems: 2
7094
+ },
7095
+ type: {
7096
+ type: "string",
7097
+ enum: [
7098
+ "block"
7099
+ ]
7100
+ },
7101
+ location: {
7102
+ $ref: "#/definitions/Location"
7103
+ },
7104
+ margin: {
7105
+ type: "string"
7106
+ },
7107
+ config: {
7108
+ type: "array",
7109
+ items: {
7110
+ anyOf: [
7111
+ {
7112
+ $ref: "#/definitions/BrokenConfigItem"
7113
+ },
7114
+ {
7115
+ $ref: "#/definitions/ConfigItem"
7116
+ }
7117
+ ]
7118
+ }
7119
+ },
7120
+ id: {
7121
+ type: "string"
7122
+ }
7123
+ },
7124
+ required: [
7125
+ "content",
7126
+ "location",
7127
+ "margin",
7128
+ "name",
7129
+ "type"
7130
+ ]
7131
+ },
7064
7132
  RootBlock: {
7065
7133
  type: "object",
7066
7134
  properties: {
@@ -7780,6 +7848,9 @@ var require_AstTree = __commonJS({
7780
7848
  {
7781
7849
  $ref: "#/definitions/BlockImage"
7782
7850
  },
7851
+ {
7852
+ $ref: "#/definitions/BlockPicture"
7853
+ },
7783
7854
  {
7784
7855
  $ref: "#/definitions/BlockCaption"
7785
7856
  },
@@ -9155,6 +9226,9 @@ var require_PodliteDocument = __commonJS({
9155
9226
  {
9156
9227
  $ref: "#/definitions/BlockImage"
9157
9228
  },
9229
+ {
9230
+ $ref: "#/definitions/BlockPicture"
9231
+ },
9158
9232
  {
9159
9233
  $ref: "#/definitions/BlockCaption"
9160
9234
  },
@@ -9493,6 +9567,71 @@ var require_PodliteDocument = __commonJS({
9493
9567
  "value"
9494
9568
  ]
9495
9569
  },
9570
+ BlockPicture: {
9571
+ type: "object",
9572
+ properties: {
9573
+ name: {
9574
+ type: "string",
9575
+ enum: [
9576
+ "picture"
9577
+ ]
9578
+ },
9579
+ caption: {
9580
+ type: "string"
9581
+ },
9582
+ link: {
9583
+ type: "string"
9584
+ },
9585
+ content: {
9586
+ type: "array",
9587
+ items: [
9588
+ {
9589
+ $ref: "#/definitions/Image"
9590
+ },
9591
+ {
9592
+ $ref: "#/definitions/BlockCaption"
9593
+ }
9594
+ ],
9595
+ minItems: 2,
9596
+ maxItems: 2
9597
+ },
9598
+ type: {
9599
+ type: "string",
9600
+ enum: [
9601
+ "block"
9602
+ ]
9603
+ },
9604
+ location: {
9605
+ $ref: "#/definitions/Location"
9606
+ },
9607
+ margin: {
9608
+ type: "string"
9609
+ },
9610
+ config: {
9611
+ type: "array",
9612
+ items: {
9613
+ anyOf: [
9614
+ {
9615
+ $ref: "#/definitions/BrokenConfigItem"
9616
+ },
9617
+ {
9618
+ $ref: "#/definitions/ConfigItem"
9619
+ }
9620
+ ]
9621
+ }
9622
+ },
9623
+ id: {
9624
+ type: "string"
9625
+ }
9626
+ },
9627
+ required: [
9628
+ "content",
9629
+ "location",
9630
+ "margin",
9631
+ "name",
9632
+ "type"
9633
+ ]
9634
+ },
9496
9635
  RootBlock: {
9497
9636
  type: "object",
9498
9637
  properties: {
@@ -10212,6 +10351,9 @@ var require_PodliteDocument = __commonJS({
10212
10351
  {
10213
10352
  $ref: "#/definitions/BlockImage"
10214
10353
  },
10354
+ {
10355
+ $ref: "#/definitions/BlockPicture"
10356
+ },
10215
10357
  {
10216
10358
  $ref: "#/definitions/BlockCaption"
10217
10359
  },
@@ -12041,7 +12183,7 @@ var require_grammar = __commonJS({
12041
12183
  }, peg$c117 = function(number) {
12042
12184
  return parseInt(number, 10);
12043
12185
  }, peg$c118 = function(vmargin, name, config) {
12044
- return name.match(/code|comment|output|input|markdown|toc|data/) || isNamedBlock2(name);
12186
+ return name.match(/code|comment|output|input|markdown|picture|toc|data/) || isNamedBlock2(name);
12045
12187
  }, peg$c119 = function(vmargin, name, config, margins, ename) {
12046
12188
  return vmargin.length === margins.length && name === ename;
12047
12189
  }, peg$c120 = function(vmargin, name, config, margins, line) {
@@ -12190,7 +12332,7 @@ var require_grammar = __commonJS({
12190
12332
  }, peg$c151 = /^[s]/, peg$c152 = peg$classExpectation(["s"], false, false), peg$c153 = function(line) {
12191
12333
  return { text: text4(), type: "ambient1" };
12192
12334
  }, peg$c154 = function(vmargin, name) {
12193
- return name.match(/code|comment|output|input|markdown|toc|data/) || isNamedBlock2(name);
12335
+ return name.match(/code|comment|output|input|markdown|picture|toc|data/) || isNamedBlock2(name);
12194
12336
  }, peg$c155 = function(vmargin, name, content4) {
12195
12337
  return {
12196
12338
  margin: vmargin,
@@ -12250,7 +12392,7 @@ var require_grammar = __commonJS({
12250
12392
  margin: vmargin
12251
12393
  };
12252
12394
  }, peg$c168 = function(vmargin, marker, name, config) {
12253
- return name.match(/code|comment|output|input|markdown|toc|data/) || isNamedBlock2(name);
12395
+ return name.match(/code|comment|output|input|markdown|picture|toc|data/) || isNamedBlock2(name);
12254
12396
  }, peg$c169 = function(vmargin, marker, name, config, content4) {
12255
12397
  return {
12256
12398
  type: "block",
@@ -17696,6 +17838,7 @@ var require_grammar = __commonJS({
17696
17838
  "nested",
17697
17839
  "output",
17698
17840
  "para",
17841
+ "picture",
17699
17842
  "pod",
17700
17843
  "table",
17701
17844
  "toc"
@@ -21600,7 +21743,7 @@ var require_package = __commonJS({
21600
21743
  "../podlite-schema/package.json"(exports, module) {
21601
21744
  module.exports = {
21602
21745
  name: "@podlite/schema",
21603
- version: "0.0.15",
21746
+ version: "0.0.17",
21604
21747
  description: "AST tools for Podlite markup language",
21605
21748
  main: "./src/index.ts",
21606
21749
  types: "./lib/index.d.ts",
@@ -22330,8 +22473,9 @@ var middle2 = () => (tree) => {
22330
22473
  const isCodeBlock = "name" in n && n.name === "code";
22331
22474
  const isDataBlock = "name" in n && n.name === "data";
22332
22475
  const isMarkdownBlock = "name" in n && n.name === "markdown";
22476
+ const isPictureBlock = "name" in n && n.name === "picture";
22333
22477
  const allowValues = conf.getAllValues("allow");
22334
- if ((isCodeBlock || isDataBlock || isMarkdownBlock) && allowValues.length == 0)
22478
+ if ((isCodeBlock || isDataBlock || isMarkdownBlock || isPictureBlock) && allowValues.length == 0)
22335
22479
  return n;
22336
22480
  const allowed = allowValues.sort();
22337
22481
  const transformer = makeTransformer_default({
@@ -31095,7 +31239,7 @@ var md2ast = (src, { lineOffset } = { lineOffset: 0 }) => {
31095
31239
  ":code": (writer, processor) => (node, ctx, interator) => {
31096
31240
  const { children, position: position2, lang, meta, ...attr } = node;
31097
31241
  if (lang === "mermaid" || lang === "diagram") {
31098
- return mkBlock({ type: "block", name: "Diagram", config: [], location: applyLineOffset(position2) }, [
31242
+ return mkBlock({ type: "block", name: "Mermaid", config: [], location: applyLineOffset(position2) }, [
31099
31243
  mkVerbatim(node.value)
31100
31244
  ]);
31101
31245
  }