@cccsaurora/clue-ui 1.5.0-dev.460 → 1.5.0-dev.467

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.
@@ -740,7 +740,7 @@ const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(_ref8,
740
740
  style: styleProp,
741
741
  to,
742
742
  viewTransition,
743
- children
743
+ children: children2
744
744
  } = _ref8, rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);
745
745
  let path = useResolvedPath(to, {
746
746
  relative: rest.relative
@@ -788,7 +788,7 @@ const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(_ref8,
788
788
  style: style2,
789
789
  to,
790
790
  viewTransition
791
- }), typeof children === "function" ? children(renderProps) : children);
791
+ }), typeof children2 === "function" ? children2(renderProps) : children2);
792
792
  });
793
793
  if (process.env.NODE_ENV !== "production") {
794
794
  NavLink.displayName = "NavLink";
@@ -2315,7 +2315,7 @@ function mark$1(values, key, value) {
2315
2315
  }
2316
2316
  }
2317
2317
  function create$1(definition) {
2318
- const properties = {};
2318
+ const properties2 = {};
2319
2319
  const normals = {};
2320
2320
  for (const [property, value] of Object.entries(definition.properties)) {
2321
2321
  const info = new DefinedInfo$1(
@@ -2327,13 +2327,13 @@ function create$1(definition) {
2327
2327
  if (definition.mustUseProperty && definition.mustUseProperty.includes(property)) {
2328
2328
  info.mustUseProperty = true;
2329
2329
  }
2330
- properties[property] = info;
2330
+ properties2[property] = info;
2331
2331
  normals[normalize$1(property)] = property;
2332
2332
  normals[normalize$1(info.attribute)] = property;
2333
2333
  }
2334
- return new Schema$1(properties, normals, definition.space);
2334
+ return new Schema$1(properties2, normals, definition.space);
2335
2335
  }
2336
- const aria$1 = create$1({
2336
+ const aria$2 = create$1({
2337
2337
  properties: {
2338
2338
  ariaActiveDescendant: null,
2339
2339
  ariaAtomic: booleanish$1,
@@ -3379,8 +3379,8 @@ function kebab$1($0) {
3379
3379
  function camelcase$1($0) {
3380
3380
  return $0.charAt(1).toUpperCase();
3381
3381
  }
3382
- const html$2 = merge$1([aria$1, html$3, xlink$1, xmlns$1, xml$1], "html");
3383
- const svg$2 = merge$1([aria$1, svg$3, xlink$1, xmlns$1, xml$1], "svg");
3382
+ const html$2 = merge$1([aria$2, html$3, xlink$1, xmlns$1, xml$1], "html");
3383
+ const svg$2 = merge$1([aria$2, svg$3, xlink$1, xmlns$1, xml$1], "svg");
3384
3384
  function parse$1(value) {
3385
3385
  const tokens = [];
3386
3386
  const input = String(value || "");
@@ -3453,29 +3453,29 @@ function stringify(values) {
3453
3453
  }
3454
3454
  function createH(schema, defaultTagName, caseSensitive) {
3455
3455
  const adjust = caseSensitive ? createAdjustMap(caseSensitive) : void 0;
3456
- function h2(selector, properties, ...children) {
3456
+ function h2(selector, properties2, ...children2) {
3457
3457
  let node;
3458
3458
  if (selector === null || selector === void 0) {
3459
3459
  node = { type: "root", children: [] };
3460
3460
  const child = (
3461
3461
  /** @type {Child} */
3462
- properties
3462
+ properties2
3463
3463
  );
3464
- children.unshift(child);
3464
+ children2.unshift(child);
3465
3465
  } else {
3466
3466
  node = parseSelector(selector, defaultTagName);
3467
3467
  const lower = node.tagName.toLowerCase();
3468
3468
  const adjusted = adjust ? adjust.get(lower) : void 0;
3469
3469
  node.tagName = adjusted || lower;
3470
- if (isChild(properties)) {
3471
- children.unshift(properties);
3470
+ if (isChild(properties2)) {
3471
+ children2.unshift(properties2);
3472
3472
  } else {
3473
- for (const [key, value] of Object.entries(properties)) {
3473
+ for (const [key, value] of Object.entries(properties2)) {
3474
3474
  addProperty(schema, node.properties, key, value);
3475
3475
  }
3476
3476
  }
3477
3477
  }
3478
- for (const child of children) {
3478
+ for (const child of children2) {
3479
3479
  addChild(node.children, child);
3480
3480
  }
3481
3481
  if (node.type === "element" && node.tagName === "template") {
@@ -3516,7 +3516,7 @@ function isChild(value) {
3516
3516
  }
3517
3517
  return false;
3518
3518
  }
3519
- function addProperty(schema, properties, key, value) {
3519
+ function addProperty(schema, properties2, key, value) {
3520
3520
  const info = find$1(schema, key);
3521
3521
  let result;
3522
3522
  if (value === null || value === void 0) return;
@@ -3550,13 +3550,13 @@ function addProperty(schema, properties, key, value) {
3550
3550
  }
3551
3551
  result = finalResult;
3552
3552
  }
3553
- if (info.property === "className" && Array.isArray(properties.className)) {
3554
- result = properties.className.concat(
3553
+ if (info.property === "className" && Array.isArray(properties2.className)) {
3554
+ result = properties2.className.concat(
3555
3555
  /** @type {Array<number | string> | number | string} */
3556
3556
  result
3557
3557
  );
3558
3558
  }
3559
- properties[info.property] = result;
3559
+ properties2[info.property] = result;
3560
3560
  }
3561
3561
  function addChild(nodes, value) {
3562
3562
  if (value === null || value === void 0) ;
@@ -3698,7 +3698,7 @@ const webNamespaces = {
3698
3698
  xml: "http://www.w3.org/XML/1998/namespace",
3699
3699
  xmlns: "http://www.w3.org/2000/xmlns/"
3700
3700
  };
3701
- const own$3 = {}.hasOwnProperty;
3701
+ const own$4 = {}.hasOwnProperty;
3702
3702
  const proto = Object.prototype;
3703
3703
  function fromParse5(tree, options) {
3704
3704
  const settings = options || {};
@@ -3721,7 +3721,7 @@ function one$1(state, node) {
3721
3721
  node
3722
3722
  );
3723
3723
  result = { type: "comment", value: reference.data };
3724
- patch$1(state, reference, result);
3724
+ patch$2(state, reference, result);
3725
3725
  return result;
3726
3726
  }
3727
3727
  case "#document":
@@ -3751,7 +3751,7 @@ function one$1(state, node) {
3751
3751
  node
3752
3752
  );
3753
3753
  result = { type: "doctype" };
3754
- patch$1(state, reference, result);
3754
+ patch$2(state, reference, result);
3755
3755
  return result;
3756
3756
  }
3757
3757
  case "#text": {
@@ -3760,7 +3760,7 @@ function one$1(state, node) {
3760
3760
  node
3761
3761
  );
3762
3762
  result = { type: "text", value: reference.value };
3763
- patch$1(state, reference, result);
3763
+ patch$2(state, reference, result);
3764
3764
  return result;
3765
3765
  }
3766
3766
  // Element.
@@ -3769,7 +3769,7 @@ function one$1(state, node) {
3769
3769
  /** @type {DefaultTreeAdapterMap['element']} */
3770
3770
  node
3771
3771
  );
3772
- result = element$2(state, reference);
3772
+ result = element$3(state, reference);
3773
3773
  return result;
3774
3774
  }
3775
3775
  }
@@ -3786,29 +3786,29 @@ function all$2(state, nodes) {
3786
3786
  }
3787
3787
  return results;
3788
3788
  }
3789
- function element$2(state, node) {
3789
+ function element$3(state, node) {
3790
3790
  const schema = state.schema;
3791
3791
  state.schema = node.namespaceURI === webNamespaces.svg ? svg$2 : html$2;
3792
3792
  let index = -1;
3793
- const properties = {};
3793
+ const properties2 = {};
3794
3794
  while (++index < node.attrs.length) {
3795
3795
  const attribute = node.attrs[index];
3796
3796
  const name = (attribute.prefix ? attribute.prefix + ":" : "") + attribute.name;
3797
- if (!own$3.call(proto, name)) {
3798
- properties[name] = attribute.value;
3797
+ if (!own$4.call(proto, name)) {
3798
+ properties2[name] = attribute.value;
3799
3799
  }
3800
3800
  }
3801
3801
  const x = state.schema.space === "svg" ? s : h;
3802
- const result = x(node.tagName, properties, all$2(state, node.childNodes));
3803
- patch$1(state, node, result);
3802
+ const result = x(node.tagName, properties2, all$2(state, node.childNodes));
3803
+ patch$2(state, node, result);
3804
3804
  if (result.tagName === "template") {
3805
3805
  const reference = (
3806
3806
  /** @type {DefaultTreeAdapterMap['template']} */
3807
3807
  node
3808
3808
  );
3809
3809
  const pos = reference.sourceCodeLocation;
3810
- const startTag2 = pos && pos.startTag && position(pos.startTag);
3811
- const endTag2 = pos && pos.endTag && position(pos.endTag);
3810
+ const startTag2 = pos && pos.startTag && position$1(pos.startTag);
3811
+ const endTag2 = pos && pos.endTag && position$1(pos.endTag);
3812
3812
  const content = (
3813
3813
  /** @type {Root} */
3814
3814
  one$1(state, reference.content)
@@ -3821,7 +3821,7 @@ function element$2(state, node) {
3821
3821
  state.schema = schema;
3822
3822
  return result;
3823
3823
  }
3824
- function patch$1(state, from, to) {
3824
+ function patch$2(state, from, to) {
3825
3825
  if ("sourceCodeLocation" in from && from.sourceCodeLocation && state.file) {
3826
3826
  const position2 = createLocation(state, to, from.sourceCodeLocation);
3827
3827
  if (position2) {
@@ -3831,36 +3831,36 @@ function patch$1(state, from, to) {
3831
3831
  }
3832
3832
  }
3833
3833
  function createLocation(state, node, location2) {
3834
- const result = position(location2);
3834
+ const result = position$1(location2);
3835
3835
  if (node.type === "element") {
3836
3836
  const tail = node.children[node.children.length - 1];
3837
3837
  if (result && !location2.endTag && tail && tail.position && tail.position.end) {
3838
3838
  result.end = Object.assign({}, tail.position.end);
3839
3839
  }
3840
3840
  if (state.verbose) {
3841
- const properties = {};
3841
+ const properties2 = {};
3842
3842
  let key;
3843
3843
  if (location2.attrs) {
3844
3844
  for (key in location2.attrs) {
3845
- if (own$3.call(location2.attrs, key)) {
3846
- properties[find$1(state.schema, key).property] = position(
3845
+ if (own$4.call(location2.attrs, key)) {
3846
+ properties2[find$1(state.schema, key).property] = position$1(
3847
3847
  location2.attrs[key]
3848
3848
  );
3849
3849
  }
3850
3850
  }
3851
3851
  }
3852
3852
  ok$1(location2.startTag);
3853
- const opening = position(location2.startTag);
3854
- const closing = location2.endTag ? position(location2.endTag) : void 0;
3853
+ const opening = position$1(location2.startTag);
3854
+ const closing = location2.endTag ? position$1(location2.endTag) : void 0;
3855
3855
  const data = { opening };
3856
3856
  if (closing) data.closing = closing;
3857
- data.properties = properties;
3857
+ data.properties = properties2;
3858
3858
  node.data = { position: data };
3859
3859
  }
3860
3860
  }
3861
3861
  return result;
3862
3862
  }
3863
- function position(loc) {
3863
+ function position$1(loc) {
3864
3864
  const start = point$1({
3865
3865
  line: loc.startLine,
3866
3866
  column: loc.startCol,
@@ -3976,13 +3976,13 @@ function mark(values, key, value) {
3976
3976
  values[key] = value;
3977
3977
  }
3978
3978
  }
3979
- const own$2 = {}.hasOwnProperty;
3979
+ const own$3 = {}.hasOwnProperty;
3980
3980
  function create(definition) {
3981
3981
  const property = {};
3982
3982
  const normal = {};
3983
3983
  let prop;
3984
3984
  for (prop in definition.properties) {
3985
- if (own$2.call(definition.properties, prop)) {
3985
+ if (own$3.call(definition.properties, prop)) {
3986
3986
  const value = definition.properties[prop];
3987
3987
  const info = new DefinedInfo2(
3988
3988
  prop,
@@ -4034,7 +4034,7 @@ const xmlns = create({
4034
4034
  transform: caseInsensitiveTransform,
4035
4035
  properties: { xmlns: null, xmlnsXLink: null }
4036
4036
  });
4037
- const aria = create({
4037
+ const aria$1 = create({
4038
4038
  transform(_, prop) {
4039
4039
  return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase();
4040
4040
  },
@@ -5046,17 +5046,17 @@ function kebab($0) {
5046
5046
  function camelcase($0) {
5047
5047
  return $0.charAt(1).toUpperCase();
5048
5048
  }
5049
- const html = merge([xml, xlink, xmlns, aria, html$1], "html");
5050
- const svg = merge([xml, xlink, xmlns, aria, svg$1], "svg");
5051
- const own$1 = {}.hasOwnProperty;
5049
+ const html = merge([xml, xlink, xmlns, aria$1, html$1], "html");
5050
+ const svg = merge([xml, xlink, xmlns, aria$1, svg$1], "svg");
5051
+ const own$2 = {}.hasOwnProperty;
5052
5052
  function zwitch(key, options) {
5053
5053
  const settings = options || {};
5054
5054
  function one2(value, ...parameters) {
5055
5055
  let fn = one2.invalid;
5056
5056
  const handlers = one2.handlers;
5057
- if (value && own$1.call(value, key)) {
5057
+ if (value && own$2.call(value, key)) {
5058
5058
  const id = String(value[key]);
5059
- fn = own$1.call(handlers, id) ? handlers[id] : one2.unknown;
5059
+ fn = own$2.call(handlers, id) ? handlers[id] : one2.unknown;
5060
5060
  }
5061
5061
  if (fn) {
5062
5062
  return fn.call(this, value, ...parameters);
@@ -5068,14 +5068,14 @@ function zwitch(key, options) {
5068
5068
  return one2;
5069
5069
  }
5070
5070
  const emptyOptions = {};
5071
- const own = {}.hasOwnProperty;
5072
- const one = zwitch("type", { handlers: { root: root$1, element: element$1, text: text$1, comment: comment$1, doctype: doctype$1 } });
5071
+ const own$1 = {}.hasOwnProperty;
5072
+ const one = zwitch("type", { handlers: { root: root$2, element: element$2, text: text$2, comment: comment$2, doctype: doctype$2 } });
5073
5073
  function toParse5(tree, options) {
5074
5074
  const settings = options || emptyOptions;
5075
5075
  const space = settings.space;
5076
5076
  return one(tree, space === "svg" ? svg : html);
5077
5077
  }
5078
- function root$1(node, schema) {
5078
+ function root$2(node, schema) {
5079
5079
  const result = {
5080
5080
  nodeName: "#document",
5081
5081
  // @ts-expect-error: `parse5` uses enums, which are actually strings.
@@ -5083,16 +5083,16 @@ function root$1(node, schema) {
5083
5083
  childNodes: []
5084
5084
  };
5085
5085
  result.childNodes = all$1(node.children, result, schema);
5086
- patch(node, result);
5086
+ patch$1(node, result);
5087
5087
  return result;
5088
5088
  }
5089
5089
  function fragment(node, schema) {
5090
5090
  const result = { nodeName: "#document-fragment", childNodes: [] };
5091
5091
  result.childNodes = all$1(node.children, result, schema);
5092
- patch(node, result);
5092
+ patch$1(node, result);
5093
5093
  return result;
5094
5094
  }
5095
- function doctype$1(node) {
5095
+ function doctype$2(node) {
5096
5096
  const result = {
5097
5097
  nodeName: "#documentType",
5098
5098
  name: "html",
@@ -5100,28 +5100,28 @@ function doctype$1(node) {
5100
5100
  systemId: "",
5101
5101
  parentNode: null
5102
5102
  };
5103
- patch(node, result);
5103
+ patch$1(node, result);
5104
5104
  return result;
5105
5105
  }
5106
- function text$1(node) {
5106
+ function text$2(node) {
5107
5107
  const result = {
5108
5108
  nodeName: "#text",
5109
5109
  value: node.value,
5110
5110
  parentNode: null
5111
5111
  };
5112
- patch(node, result);
5112
+ patch$1(node, result);
5113
5113
  return result;
5114
5114
  }
5115
- function comment$1(node) {
5115
+ function comment$2(node) {
5116
5116
  const result = {
5117
5117
  nodeName: "#comment",
5118
5118
  data: node.value,
5119
5119
  parentNode: null
5120
5120
  };
5121
- patch(node, result);
5121
+ patch$1(node, result);
5122
5122
  return result;
5123
5123
  }
5124
- function element$1(node, schema) {
5124
+ function element$2(node, schema) {
5125
5125
  const parentSchema = schema;
5126
5126
  let currentSchema = parentSchema;
5127
5127
  if (node.type === "element" && node.tagName.toLowerCase() === "svg" && parentSchema.space === "html") {
@@ -5131,7 +5131,7 @@ function element$1(node, schema) {
5131
5131
  let prop;
5132
5132
  if (node.properties) {
5133
5133
  for (prop in node.properties) {
5134
- if (prop !== "children" && own.call(node.properties, prop)) {
5134
+ if (prop !== "children" && own$1.call(node.properties, prop)) {
5135
5135
  const result2 = createProperty(
5136
5136
  currentSchema,
5137
5137
  prop,
@@ -5154,7 +5154,7 @@ function element$1(node, schema) {
5154
5154
  parentNode: null
5155
5155
  };
5156
5156
  result.childNodes = all$1(node.children, result, currentSchema);
5157
- patch(node, result);
5157
+ patch$1(node, result);
5158
5158
  if (node.tagName === "template" && node.content) {
5159
5159
  result.content = fragment(node.content, currentSchema);
5160
5160
  }
@@ -5184,19 +5184,19 @@ function createProperty(schema, prop, value) {
5184
5184
  }
5185
5185
  return attribute;
5186
5186
  }
5187
- function all$1(children, parentNode, schema) {
5187
+ function all$1(children2, parentNode, schema) {
5188
5188
  let index = -1;
5189
5189
  const results = [];
5190
- if (children) {
5191
- while (++index < children.length) {
5192
- const child = one(children[index], schema);
5190
+ if (children2) {
5191
+ while (++index < children2.length) {
5192
+ const child = one(children2[index], schema);
5193
5193
  child.parentNode = parentNode;
5194
5194
  results.push(child);
5195
5195
  }
5196
5196
  }
5197
5197
  return results;
5198
5198
  }
5199
- function patch(from, to) {
5199
+ function patch$1(from, to) {
5200
5200
  const position2 = from.position;
5201
5201
  if (position2 && position2.start && position2.end) {
5202
5202
  ok$1(typeof position2.start.offset === "number");
@@ -13025,6 +13025,13 @@ function point(type) {
13025
13025
  }
13026
13026
  }
13027
13027
  }
13028
+ function position(node) {
13029
+ const start = pointStart(node);
13030
+ const end = pointEnd(node);
13031
+ if (start && end) {
13032
+ return { start, end };
13033
+ }
13034
+ }
13028
13035
  const convert = (
13029
13036
  // Note: overloads in JSDoc can’t yet use different `@template`s.
13030
13037
  /**
@@ -13221,7 +13228,7 @@ const parseOptions = { sourceCodeLocationInfo: true, scriptingEnabled: false };
13221
13228
  function raw(tree, options) {
13222
13229
  const document2 = documentMode(tree);
13223
13230
  const one2 = zwitch("type", {
13224
- handlers: { root, element, text, comment, doctype, raw: handleRaw },
13231
+ handlers: { root: root$1, element: element$1, text: text$1, comment: comment$1, doctype: doctype$1, raw: handleRaw },
13225
13232
  unknown
13226
13233
  });
13227
13234
  const state = {
@@ -13266,15 +13273,15 @@ function all(nodes, state) {
13266
13273
  }
13267
13274
  }
13268
13275
  }
13269
- function root(node, state) {
13276
+ function root$1(node, state) {
13270
13277
  all(node.children, state);
13271
13278
  }
13272
- function element(node, state) {
13279
+ function element$1(node, state) {
13273
13280
  startTag(node, state);
13274
13281
  all(node.children, state);
13275
13282
  endTag(node, state);
13276
13283
  }
13277
- function text(node, state) {
13284
+ function text$1(node, state) {
13278
13285
  if (state.parser.tokenizer.state > 4) {
13279
13286
  state.parser.tokenizer.state = 0;
13280
13287
  }
@@ -13287,7 +13294,7 @@ function text(node, state) {
13287
13294
  state.parser.currentToken = token;
13288
13295
  state.parser._processToken(state.parser.currentToken);
13289
13296
  }
13290
- function doctype(node, state) {
13297
+ function doctype$1(node, state) {
13291
13298
  const token = {
13292
13299
  type: TokenType.DOCTYPE,
13293
13300
  name: "html",
@@ -13310,9 +13317,9 @@ function stitch(node, state) {
13310
13317
  );
13311
13318
  clone.children = fakeRoot.children;
13312
13319
  }
13313
- comment({ type: "comment", value: { stitch: clone } }, state);
13320
+ comment$1({ type: "comment", value: { stitch: clone } }, state);
13314
13321
  }
13315
- function comment(node, state) {
13322
+ function comment$1(node, state) {
13316
13323
  const data = node.value;
13317
13324
  const token = {
13318
13325
  type: TokenType.COMMENT,
@@ -13494,8 +13501,477 @@ function rehypeRaw(options) {
13494
13501
  return result;
13495
13502
  };
13496
13503
  }
13497
- const customComponents = (type, children) => {
13498
- const child = children instanceof Array ? children[0] : children;
13504
+ const aria = ["ariaDescribedBy", "ariaLabel", "ariaLabelledBy"];
13505
+ const defaultSchema = {
13506
+ ancestors: {
13507
+ tbody: ["table"],
13508
+ td: ["table"],
13509
+ th: ["table"],
13510
+ thead: ["table"],
13511
+ tfoot: ["table"],
13512
+ tr: ["table"]
13513
+ },
13514
+ attributes: {
13515
+ a: [
13516
+ ...aria,
13517
+ // Note: these 3 are used by GFM footnotes, they do work on all links.
13518
+ "dataFootnoteBackref",
13519
+ "dataFootnoteRef",
13520
+ ["className", "data-footnote-backref"],
13521
+ "href"
13522
+ ],
13523
+ blockquote: ["cite"],
13524
+ // Note: this class is not normally allowed by GH, when manually writing
13525
+ // `code` as HTML in markdown, they adds it some other way.
13526
+ // We can’t do that, so we have to allow it.
13527
+ code: [["className", /^language-./]],
13528
+ del: ["cite"],
13529
+ div: ["itemScope", "itemType"],
13530
+ dl: [...aria],
13531
+ // Note: this is used by GFM footnotes.
13532
+ h2: [["className", "sr-only"]],
13533
+ img: [...aria, "longDesc", "src"],
13534
+ // Note: `input` is not normally allowed by GH, when manually writing
13535
+ // it in markdown, they add it from tasklists some other way.
13536
+ // We can’t do that, so we have to allow it.
13537
+ input: [
13538
+ ["disabled", true],
13539
+ ["type", "checkbox"]
13540
+ ],
13541
+ ins: ["cite"],
13542
+ // Note: this class is not normally allowed by GH, when manually writing
13543
+ // `li` as HTML in markdown, they adds it some other way.
13544
+ // We can’t do that, so we have to allow it.
13545
+ li: [["className", "task-list-item"]],
13546
+ // Note: this class is not normally allowed by GH, when manually writing
13547
+ // `ol` as HTML in markdown, they adds it some other way.
13548
+ // We can’t do that, so we have to allow it.
13549
+ ol: [...aria, ["className", "contains-task-list"]],
13550
+ q: ["cite"],
13551
+ section: ["dataFootnotes", ["className", "footnotes"]],
13552
+ source: ["srcSet"],
13553
+ summary: [...aria],
13554
+ table: [...aria],
13555
+ // Note: this class is not normally allowed by GH, when manually writing
13556
+ // `ol` as HTML in markdown, they adds it some other way.
13557
+ // We can’t do that, so we have to allow it.
13558
+ ul: [...aria, ["className", "contains-task-list"]],
13559
+ "*": [
13560
+ "abbr",
13561
+ "accept",
13562
+ "acceptCharset",
13563
+ "accessKey",
13564
+ "action",
13565
+ "align",
13566
+ "alt",
13567
+ "axis",
13568
+ "border",
13569
+ "cellPadding",
13570
+ "cellSpacing",
13571
+ "char",
13572
+ "charOff",
13573
+ "charSet",
13574
+ "checked",
13575
+ "clear",
13576
+ "colSpan",
13577
+ "color",
13578
+ "cols",
13579
+ "compact",
13580
+ "coords",
13581
+ "dateTime",
13582
+ "dir",
13583
+ // Note: `disabled` is technically allowed on all elements by GH.
13584
+ // But it is useless on everything except `input`.
13585
+ // Because `input`s are normally not allowed, but we allow them for
13586
+ // checkboxes due to tasklists, we allow `disabled` only there.
13587
+ "encType",
13588
+ "frame",
13589
+ "hSpace",
13590
+ "headers",
13591
+ "height",
13592
+ "hrefLang",
13593
+ "htmlFor",
13594
+ "id",
13595
+ "isMap",
13596
+ "itemProp",
13597
+ "label",
13598
+ "lang",
13599
+ "maxLength",
13600
+ "media",
13601
+ "method",
13602
+ "multiple",
13603
+ "name",
13604
+ "noHref",
13605
+ "noShade",
13606
+ "noWrap",
13607
+ "open",
13608
+ "prompt",
13609
+ "readOnly",
13610
+ "rev",
13611
+ "rowSpan",
13612
+ "rows",
13613
+ "rules",
13614
+ "scope",
13615
+ "selected",
13616
+ "shape",
13617
+ "size",
13618
+ "span",
13619
+ "start",
13620
+ "summary",
13621
+ "tabIndex",
13622
+ "title",
13623
+ "useMap",
13624
+ "vAlign",
13625
+ "value",
13626
+ "width"
13627
+ ]
13628
+ },
13629
+ clobber: ["ariaDescribedBy", "ariaLabelledBy", "id", "name"],
13630
+ clobberPrefix: "user-content-",
13631
+ protocols: {
13632
+ cite: ["http", "https"],
13633
+ href: ["http", "https", "irc", "ircs", "mailto", "xmpp"],
13634
+ longDesc: ["http", "https"],
13635
+ src: ["http", "https"]
13636
+ },
13637
+ required: {
13638
+ input: { disabled: true, type: "checkbox" }
13639
+ },
13640
+ strip: ["script"],
13641
+ tagNames: [
13642
+ "a",
13643
+ "b",
13644
+ "blockquote",
13645
+ "br",
13646
+ "code",
13647
+ "dd",
13648
+ "del",
13649
+ "details",
13650
+ "div",
13651
+ "dl",
13652
+ "dt",
13653
+ "em",
13654
+ "h1",
13655
+ "h2",
13656
+ "h3",
13657
+ "h4",
13658
+ "h5",
13659
+ "h6",
13660
+ "hr",
13661
+ "i",
13662
+ "img",
13663
+ // Note: `input` is not normally allowed by GH, when manually writing
13664
+ // it in markdown, they add it from tasklists some other way.
13665
+ // We can’t do that, so we have to allow it.
13666
+ "input",
13667
+ "ins",
13668
+ "kbd",
13669
+ "li",
13670
+ "ol",
13671
+ "p",
13672
+ "picture",
13673
+ "pre",
13674
+ "q",
13675
+ "rp",
13676
+ "rt",
13677
+ "ruby",
13678
+ "s",
13679
+ "samp",
13680
+ "section",
13681
+ "source",
13682
+ "span",
13683
+ "strike",
13684
+ "strong",
13685
+ "sub",
13686
+ "summary",
13687
+ "sup",
13688
+ "table",
13689
+ "tbody",
13690
+ "td",
13691
+ "tfoot",
13692
+ "th",
13693
+ "thead",
13694
+ "tr",
13695
+ "tt",
13696
+ "ul",
13697
+ "var"
13698
+ ]
13699
+ };
13700
+ const own = {}.hasOwnProperty;
13701
+ function sanitize(node, options) {
13702
+ let result = { type: "root", children: [] };
13703
+ const state = {
13704
+ schema: options ? { ...defaultSchema, ...options } : defaultSchema,
13705
+ stack: []
13706
+ };
13707
+ const replace = transform(state, node);
13708
+ if (replace) {
13709
+ if (Array.isArray(replace)) {
13710
+ if (replace.length === 1) {
13711
+ result = replace[0];
13712
+ } else {
13713
+ result.children = replace;
13714
+ }
13715
+ } else {
13716
+ result = replace;
13717
+ }
13718
+ }
13719
+ return result;
13720
+ }
13721
+ function transform(state, node) {
13722
+ if (node && typeof node === "object") {
13723
+ const unsafe = (
13724
+ /** @type {Record<string, Readonly<unknown>>} */
13725
+ node
13726
+ );
13727
+ const type = typeof unsafe.type === "string" ? unsafe.type : "";
13728
+ switch (type) {
13729
+ case "comment": {
13730
+ return comment(state, unsafe);
13731
+ }
13732
+ case "doctype": {
13733
+ return doctype(state, unsafe);
13734
+ }
13735
+ case "element": {
13736
+ return element(state, unsafe);
13737
+ }
13738
+ case "root": {
13739
+ return root(state, unsafe);
13740
+ }
13741
+ case "text": {
13742
+ return text(state, unsafe);
13743
+ }
13744
+ }
13745
+ }
13746
+ }
13747
+ function comment(state, unsafe) {
13748
+ if (state.schema.allowComments) {
13749
+ const result = typeof unsafe.value === "string" ? unsafe.value : "";
13750
+ const index = result.indexOf("-->");
13751
+ const value = index < 0 ? result : result.slice(0, index);
13752
+ const node = { type: "comment", value };
13753
+ patch(node, unsafe);
13754
+ return node;
13755
+ }
13756
+ }
13757
+ function doctype(state, unsafe) {
13758
+ if (state.schema.allowDoctypes) {
13759
+ const node = { type: "doctype" };
13760
+ patch(node, unsafe);
13761
+ return node;
13762
+ }
13763
+ }
13764
+ function element(state, unsafe) {
13765
+ const name = typeof unsafe.tagName === "string" ? unsafe.tagName : "";
13766
+ state.stack.push(name);
13767
+ const content = (
13768
+ /** @type {Array<ElementContent>} */
13769
+ children(state, unsafe.children)
13770
+ );
13771
+ const properties_ = properties(state, unsafe.properties);
13772
+ state.stack.pop();
13773
+ let safeElement = false;
13774
+ if (name && name !== "*" && (!state.schema.tagNames || state.schema.tagNames.includes(name))) {
13775
+ safeElement = true;
13776
+ if (state.schema.ancestors && own.call(state.schema.ancestors, name)) {
13777
+ const ancestors = state.schema.ancestors[name];
13778
+ let index = -1;
13779
+ safeElement = false;
13780
+ while (++index < ancestors.length) {
13781
+ if (state.stack.includes(ancestors[index])) {
13782
+ safeElement = true;
13783
+ }
13784
+ }
13785
+ }
13786
+ }
13787
+ if (!safeElement) {
13788
+ return state.schema.strip && !state.schema.strip.includes(name) ? content : void 0;
13789
+ }
13790
+ const node = {
13791
+ type: "element",
13792
+ tagName: name,
13793
+ properties: properties_,
13794
+ children: content
13795
+ };
13796
+ patch(node, unsafe);
13797
+ return node;
13798
+ }
13799
+ function root(state, unsafe) {
13800
+ const content = (
13801
+ /** @type {Array<RootContent>} */
13802
+ children(state, unsafe.children)
13803
+ );
13804
+ const node = { type: "root", children: content };
13805
+ patch(node, unsafe);
13806
+ return node;
13807
+ }
13808
+ function text(_, unsafe) {
13809
+ const value = typeof unsafe.value === "string" ? unsafe.value : "";
13810
+ const node = { type: "text", value };
13811
+ patch(node, unsafe);
13812
+ return node;
13813
+ }
13814
+ function children(state, children2) {
13815
+ const results = [];
13816
+ if (Array.isArray(children2)) {
13817
+ const childrenUnknown = (
13818
+ /** @type {Array<Readonly<unknown>>} */
13819
+ children2
13820
+ );
13821
+ let index = -1;
13822
+ while (++index < childrenUnknown.length) {
13823
+ const value = transform(state, childrenUnknown[index]);
13824
+ if (value) {
13825
+ if (Array.isArray(value)) {
13826
+ results.push(...value);
13827
+ } else {
13828
+ results.push(value);
13829
+ }
13830
+ }
13831
+ }
13832
+ }
13833
+ return results;
13834
+ }
13835
+ function properties(state, properties2) {
13836
+ const tagName = state.stack[state.stack.length - 1];
13837
+ const attributes = state.schema.attributes;
13838
+ const required = state.schema.required;
13839
+ const specific = attributes && own.call(attributes, tagName) ? attributes[tagName] : void 0;
13840
+ const defaults = attributes && own.call(attributes, "*") ? attributes["*"] : void 0;
13841
+ const properties_ = (
13842
+ /** @type {Readonly<Record<string, Readonly<unknown>>>} */
13843
+ properties2 && typeof properties2 === "object" ? properties2 : {}
13844
+ );
13845
+ const result = {};
13846
+ let key;
13847
+ for (key in properties_) {
13848
+ if (own.call(properties_, key)) {
13849
+ const unsafe = properties_[key];
13850
+ let safe = propertyValue(
13851
+ state,
13852
+ findDefinition(specific, key),
13853
+ key,
13854
+ unsafe
13855
+ );
13856
+ if (safe === null || safe === void 0) {
13857
+ safe = propertyValue(state, findDefinition(defaults, key), key, unsafe);
13858
+ }
13859
+ if (safe !== null && safe !== void 0) {
13860
+ result[key] = safe;
13861
+ }
13862
+ }
13863
+ }
13864
+ if (required && own.call(required, tagName)) {
13865
+ const properties3 = required[tagName];
13866
+ for (key in properties3) {
13867
+ if (own.call(properties3, key) && !own.call(result, key)) {
13868
+ result[key] = properties3[key];
13869
+ }
13870
+ }
13871
+ }
13872
+ return result;
13873
+ }
13874
+ function propertyValue(state, definition, key, value) {
13875
+ return definition ? Array.isArray(value) ? propertyValueMany(state, definition, key, value) : propertyValuePrimitive(state, definition, key, value) : void 0;
13876
+ }
13877
+ function propertyValueMany(state, definition, key, values) {
13878
+ let index = -1;
13879
+ const result = [];
13880
+ while (++index < values.length) {
13881
+ const value = propertyValuePrimitive(state, definition, key, values[index]);
13882
+ if (typeof value === "number" || typeof value === "string") {
13883
+ result.push(value);
13884
+ }
13885
+ }
13886
+ return result;
13887
+ }
13888
+ function propertyValuePrimitive(state, definition, key, value) {
13889
+ if (typeof value !== "boolean" && typeof value !== "number" && typeof value !== "string") {
13890
+ return;
13891
+ }
13892
+ if (!safeProtocol(state, key, value)) {
13893
+ return;
13894
+ }
13895
+ if (typeof definition === "object" && definition.length > 1) {
13896
+ let ok2 = false;
13897
+ let index = 0;
13898
+ while (++index < definition.length) {
13899
+ const allowed = definition[index];
13900
+ if (allowed && typeof allowed === "object" && "flags" in allowed) {
13901
+ if (allowed.test(String(value))) {
13902
+ ok2 = true;
13903
+ break;
13904
+ }
13905
+ } else if (allowed === value) {
13906
+ ok2 = true;
13907
+ break;
13908
+ }
13909
+ }
13910
+ if (!ok2) return;
13911
+ }
13912
+ return state.schema.clobber && state.schema.clobberPrefix && state.schema.clobber.includes(key) ? state.schema.clobberPrefix + value : value;
13913
+ }
13914
+ function safeProtocol(state, key, value) {
13915
+ const protocols = state.schema.protocols && own.call(state.schema.protocols, key) ? state.schema.protocols[key] : void 0;
13916
+ if (!protocols || protocols.length === 0) {
13917
+ return true;
13918
+ }
13919
+ const url = String(value);
13920
+ const colon = url.indexOf(":");
13921
+ const questionMark = url.indexOf("?");
13922
+ const numberSign = url.indexOf("#");
13923
+ const slash = url.indexOf("/");
13924
+ if (colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
13925
+ slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign) {
13926
+ return true;
13927
+ }
13928
+ let index = -1;
13929
+ while (++index < protocols.length) {
13930
+ const protocol = protocols[index];
13931
+ if (colon === protocol.length && url.slice(0, protocol.length) === protocol) {
13932
+ return true;
13933
+ }
13934
+ }
13935
+ return false;
13936
+ }
13937
+ function patch(node, unsafe) {
13938
+ const cleanPosition = position(
13939
+ // @ts-expect-error: looks like a node.
13940
+ unsafe
13941
+ );
13942
+ if (unsafe.data) {
13943
+ node.data = structuredClone$1(unsafe.data);
13944
+ }
13945
+ if (cleanPosition) node.position = cleanPosition;
13946
+ }
13947
+ function findDefinition(definitions, key) {
13948
+ let dataDefault;
13949
+ let index = -1;
13950
+ if (definitions) {
13951
+ while (++index < definitions.length) {
13952
+ const entry = definitions[index];
13953
+ const name = typeof entry === "string" ? entry : entry[0];
13954
+ if (name === key) {
13955
+ return entry;
13956
+ }
13957
+ if (name === "data*") dataDefault = entry;
13958
+ }
13959
+ }
13960
+ if (key.length > 4 && key.slice(0, 4).toLowerCase() === "data") {
13961
+ return dataDefault;
13962
+ }
13963
+ }
13964
+ function rehypeSanitize(options) {
13965
+ return function(tree) {
13966
+ const result = (
13967
+ /** @type {Root} */
13968
+ sanitize(tree, options)
13969
+ );
13970
+ return result;
13971
+ };
13972
+ }
13973
+ const customComponents = (type, children2) => {
13974
+ const child = children2 instanceof Array ? children2[0] : children2;
13499
13975
  if (type === "alert") {
13500
13976
  return /* @__PURE__ */ jsx(Alert, { severity: "info", variant: "outlined", sx: { ".MuiAlert-message": { whiteSpace: "normal" } }, children: child });
13501
13977
  }
@@ -13508,10 +13984,10 @@ const Markdown = ({ md, components = {} }) => {
13508
13984
  return /* @__PURE__ */ jsx(
13509
13985
  ReactMarkdown,
13510
13986
  {
13511
- rehypePlugins: [rehypeRaw],
13987
+ rehypePlugins: [rehypeRaw, rehypeSanitize],
13512
13988
  remarkPlugins: [remarkGfm],
13513
13989
  components: {
13514
- code: ({ node, className, children, ...props }) => {
13990
+ code: ({ node, className, children: children2, ...props }) => {
13515
13991
  var _a;
13516
13992
  if (((_a = node.children) == null ? void 0 : _a.length) === 1 && node.children[0].type === "text") {
13517
13993
  if (node.children[0].value.startsWith("t(")) {
@@ -13522,20 +13998,20 @@ const Markdown = ({ md, components = {} }) => {
13522
13998
  }
13523
13999
  const match = /language-(\w+)/.exec(className || "");
13524
14000
  if (match && ["alert", "notebook", "tabs"].includes(match[1])) {
13525
- return customComponents(match[1], children);
14001
+ return customComponents(match[1], children2);
13526
14002
  }
13527
14003
  return !props.inline && match ? /* @__PURE__ */ jsx(
13528
14004
  Prism,
13529
14005
  {
13530
- children: String(children).replace(/\n$/, ""),
14006
+ children: String(children2).replace(/\n$/, ""),
13531
14007
  style: isDark ? oneDark : oneLight,
13532
14008
  language: match[1],
13533
14009
  PreTag: "div",
13534
14010
  ...props
13535
14011
  }
13536
- ) : /* @__PURE__ */ jsx("code", { className, ...props, children });
14012
+ ) : /* @__PURE__ */ jsx("code", { className, ...props, children: children2 });
13537
14013
  },
13538
- blockquote: ({ children, style: style2 }) => {
14014
+ blockquote: ({ children: children2, style: style2 }) => {
13539
14015
  return /* @__PURE__ */ jsx(
13540
14016
  Box,
13541
14017
  {
@@ -13544,34 +14020,34 @@ const Markdown = ({ md, components = {} }) => {
13544
14020
  pl: 1,
13545
14021
  borderLeft: `2px solid ${theme.palette.divider}`
13546
14022
  },
13547
- children
14023
+ children: children2
13548
14024
  }
13549
14025
  );
13550
14026
  },
13551
14027
  img: ({ node: _node, ...props }) => {
13552
14028
  return /* @__PURE__ */ jsx("img", { ...props, style: { ...props.style, maxWidth: "75%" } });
13553
14029
  },
13554
- table: ({ children, style: style2 }) => {
13555
- return /* @__PURE__ */ jsx(TableContainer, { component: Paper, children: /* @__PURE__ */ jsx(Table, { style: style2 ?? {}, children }) });
14030
+ table: ({ children: children2, style: style2 }) => {
14031
+ return /* @__PURE__ */ jsx(TableContainer, { component: Paper, children: /* @__PURE__ */ jsx(Table, { style: style2 ?? {}, children: children2 }) });
13556
14032
  },
13557
- thead: ({ children, style: style2 }) => {
13558
- return /* @__PURE__ */ jsx(TableHead, { style: style2 ?? {}, children });
14033
+ thead: ({ children: children2, style: style2 }) => {
14034
+ return /* @__PURE__ */ jsx(TableHead, { style: style2 ?? {}, children: children2 });
13559
14035
  },
13560
- tr: ({ children, style: style2 }) => {
13561
- return /* @__PURE__ */ jsx(TableRow, { style: style2 ?? {}, children });
14036
+ tr: ({ children: children2, style: style2 }) => {
14037
+ return /* @__PURE__ */ jsx(TableRow, { style: style2 ?? {}, children: children2 });
13562
14038
  },
13563
- th: ({ children, ...props }) => {
13564
- return /* @__PURE__ */ jsx(TableCell, { style: props.style, children });
14039
+ th: ({ children: children2, ...props }) => {
14040
+ return /* @__PURE__ */ jsx(TableCell, { style: props.style, children: children2 });
13565
14041
  },
13566
- td: ({ children, ...props }) => {
13567
- return /* @__PURE__ */ jsx(TableCell, { style: props.style, children });
14042
+ td: ({ children: children2, ...props }) => {
14043
+ return /* @__PURE__ */ jsx(TableCell, { style: props.style, children: children2 });
13568
14044
  },
13569
- a: ({ node: _node, children, ...props }) => {
14045
+ a: ({ node: _node, children: children2, ...props }) => {
13570
14046
  var _a;
13571
14047
  if ((_a = props.href) == null ? void 0 : _a.startsWith("/")) {
13572
- return /* @__PURE__ */ jsx(Link, { to: props.href, ...props, children });
14048
+ return /* @__PURE__ */ jsx(Link, { to: props.href, ...props, children: children2 });
13573
14049
  } else {
13574
- return /* @__PURE__ */ jsx("a", { ...props, children });
14050
+ return /* @__PURE__ */ jsx("a", { ...props, children: children2 });
13575
14051
  }
13576
14052
  }
13577
14053
  },
package/package.json CHANGED
@@ -29,6 +29,7 @@
29
29
  "react-pluggable": "^0.4.3",
30
30
  "react-syntax-highlighter": "^15.6.1",
31
31
  "rehype-raw": "7.0.0",
32
+ "rehype-sanitize": "^6.0.0",
32
33
  "remark-gfm": "4.0.1",
33
34
  "rxdb": "^16.16.0",
34
35
  "rxjs": "^7.8.2",
@@ -67,7 +68,7 @@
67
68
  },
68
69
  "type": "module",
69
70
  "types": "main.d.ts",
70
- "version": "1.5.0-dev.460",
71
+ "version": "1.5.0-dev.467",
71
72
  "exports": {
72
73
  ".": "./main.js",
73
74
  "./index.css": "./index.css",