@duskmoon-dev/el-markdown 0.5.0 → 0.7.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.
@@ -38,13 +38,13 @@ var require_extend = __commonJS((exports, module) => {
38
38
  var toStr = Object.prototype.toString;
39
39
  var defineProperty = Object.defineProperty;
40
40
  var gOPD = Object.getOwnPropertyDescriptor;
41
- var isArray = function isArray(arr) {
41
+ var isArray = function isArray2(arr) {
42
42
  if (typeof Array.isArray === "function") {
43
43
  return Array.isArray(arr);
44
44
  }
45
45
  return toStr.call(arr) === "[object Array]";
46
46
  };
47
- var isPlainObject = function isPlainObject(obj) {
47
+ var isPlainObject = function isPlainObject2(obj) {
48
48
  if (!obj || toStr.call(obj) !== "[object Object]") {
49
49
  return false;
50
50
  }
@@ -57,7 +57,7 @@ var require_extend = __commonJS((exports, module) => {
57
57
  for (key in obj) {}
58
58
  return typeof key === "undefined" || hasOwn.call(obj, key);
59
59
  };
60
- var setProperty = function setProperty(target, options) {
60
+ var setProperty = function setProperty2(target, options) {
61
61
  if (defineProperty && options.name === "__proto__") {
62
62
  defineProperty(target, options.name, {
63
63
  enumerable: true,
@@ -69,7 +69,7 @@ var require_extend = __commonJS((exports, module) => {
69
69
  target[options.name] = options.newValue;
70
70
  }
71
71
  };
72
- var getProperty = function getProperty(obj, name) {
72
+ var getProperty = function getProperty2(obj, name) {
73
73
  if (name === "__proto__") {
74
74
  if (!hasOwn.call(obj, name)) {
75
75
  return;
@@ -1986,7 +1986,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`);
1986
1986
  });
1987
1987
 
1988
1988
  // src/el-dm-markdown.ts
1989
- import { BaseElement, css as css2 } from "@duskmoon-dev/el-core";
1989
+ import { BaseElement, css as css2 } from "@duskmoon-dev/el-base";
1990
1990
  import { css as markdownBodyCSS } from "@duskmoon-dev/core/components/markdown-body";
1991
1991
 
1992
1992
  // ../../node_modules/.bun/bail@2.0.2/node_modules/bail/index.js
@@ -2944,7 +2944,7 @@ function all(values, includeImageAlt, includeHtml) {
2944
2944
  function node(value) {
2945
2945
  return Boolean(value && typeof value === "object");
2946
2946
  }
2947
- // ../../node_modules/.bun/decode-named-character-reference@1.2.0/node_modules/decode-named-character-reference/index.dom.js
2947
+ // ../../node_modules/.bun/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.dom.js
2948
2948
  var element = document.createElement("i");
2949
2949
  function decodeNamedCharacterReference(value) {
2950
2950
  const characterReference = "&" + value + ";";
@@ -7202,10 +7202,10 @@ function decode($0, $1, $2) {
7202
7202
  return decodeNamedCharacterReference($2) || $0;
7203
7203
  }
7204
7204
 
7205
- // ../../node_modules/.bun/mdast-util-from-markdown@2.0.2/node_modules/mdast-util-from-markdown/dev/lib/index.js
7205
+ // ../../node_modules/.bun/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/dev/lib/index.js
7206
7206
  var own2 = {}.hasOwnProperty;
7207
7207
  function fromMarkdown(value, encoding, options) {
7208
- if (typeof encoding !== "string") {
7208
+ if (encoding && typeof encoding === "object") {
7209
7209
  options = encoding;
7210
7210
  encoding = undefined;
7211
7211
  }
@@ -7333,7 +7333,7 @@ function compiler(options) {
7333
7333
  listStack.push(index2);
7334
7334
  } else {
7335
7335
  const tail = listStack.pop();
7336
- ok(typeof tail === "number", "expected list ot be open");
7336
+ ok(typeof tail === "number", "expected list to be open");
7337
7337
  index2 = prepareList(events, tail, index2);
7338
7338
  }
7339
7339
  }
@@ -8866,7 +8866,7 @@ function emphasisPeek(_, _1, state) {
8866
8866
  return state.options.emphasis || "*";
8867
8867
  }
8868
8868
 
8869
- // ../../node_modules/.bun/unist-util-visit@5.0.0/node_modules/unist-util-visit/lib/index.js
8869
+ // ../../node_modules/.bun/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js
8870
8870
  function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
8871
8871
  let reverse;
8872
8872
  let test;
@@ -27117,10 +27117,10 @@ var baseStyles = css2`
27117
27117
  :host {
27118
27118
  display: block;
27119
27119
  font-family: var(
27120
- --dm-markdown-font-family,
27120
+ --markdown-font-family,
27121
27121
  var(--font-family, system-ui, -apple-system, sans-serif)
27122
27122
  );
27123
- line-height: var(--dm-markdown-line-height, 1.6);
27123
+ line-height: var(--markdown-line-height, 1.6);
27124
27124
  color: var(--color-on-surface);
27125
27125
  }
27126
27126
 
@@ -27233,6 +27233,9 @@ class ElDmMarkdown extends BaseElement {
27233
27233
  noMermaid: { type: Boolean, reflect: true, attribute: "no-mermaid" },
27234
27234
  streaming: { type: Boolean, reflect: true }
27235
27235
  };
27236
+ static get observedAttributes() {
27237
+ return [...super.observedAttributes, "content"];
27238
+ }
27236
27239
  _mid = "";
27237
27240
  _fragment = "";
27238
27241
  _content = "";
@@ -27288,6 +27291,11 @@ class ElDmMarkdown extends BaseElement {
27288
27291
  }
27289
27292
  attributeChangedCallback(name, oldValue, newValue) {
27290
27293
  super.attributeChangedCallback(name, oldValue, newValue);
27294
+ if (name === "content" && oldValue !== newValue) {
27295
+ this.content = (newValue ?? "").replace(/\\n/g, `
27296
+ `).replace(/\\t/g, "\t");
27297
+ return;
27298
+ }
27291
27299
  if (name === "theme" && oldValue !== newValue) {
27292
27300
  this._updateTheme();
27293
27301
  }
@@ -27602,5 +27610,5 @@ function register() {
27602
27610
  // src/register.ts
27603
27611
  register();
27604
27612
 
27605
- //# debugId=8826492BE0B3A78664756E2164756E21
27613
+ //# debugId=68449F03E5E7E0A764756E2164756E21
27606
27614
  //# sourceMappingURL=register.js.map