@hyperbook/markdown 0.14.0 → 0.15.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.
@@ -0,0 +1,10 @@
1
+ .directive-geogebra {
2
+ display: flex;
3
+ justify-content: center;
4
+ margin-bottom: 12px;
5
+ }
6
+
7
+ .directive-geogebra hyperbook-geogebra {
8
+ overflow: hidden;
9
+ border-radius: 8px;
10
+ }
package/dist/index.js CHANGED
@@ -72388,6 +72388,57 @@ var remarkCollectSearchDocuments_default = (ctx) => () => {
72388
72388
  };
72389
72389
  };
72390
72390
 
72391
+ // src/remarkDirectiveGeogebra.ts
72392
+ var remarkDirectiveGeogebra_default = (ctx) => () => {
72393
+ const name = "geogebra";
72394
+ return (tree, file) => {
72395
+ visit(tree, function(node3) {
72396
+ if (isDirective(node3)) {
72397
+ if (node3.name !== name) return;
72398
+ const data = node3.data || (node3.data = {});
72399
+ registerDirective(
72400
+ file,
72401
+ name,
72402
+ [
72403
+ "https://www.geogebra.org/apps/deployggb.js",
72404
+ "geogebra-web-component.js"
72405
+ ],
72406
+ ["style.css"]
72407
+ );
72408
+ const { src, ...props } = node3.attributes || {};
72409
+ data.hName = "div";
72410
+ data.hProperties = {
72411
+ class: "directive-geogebra"
72412
+ };
72413
+ if (!src && !props.width) {
72414
+ props.width = "800";
72415
+ }
72416
+ if (!src && !props.height) {
72417
+ props.height = "600";
72418
+ }
72419
+ const value = toText2(node3);
72420
+ data.hChildren = [
72421
+ {
72422
+ type: "element",
72423
+ tagName: "hyperbook-geogebra",
72424
+ properties: {
72425
+ ...props,
72426
+ borderRadius: 8,
72427
+ material: src ? ctx.makeUrl(src, "public") : void 0
72428
+ },
72429
+ children: [
72430
+ {
72431
+ type: "raw",
72432
+ value
72433
+ }
72434
+ ]
72435
+ }
72436
+ ];
72437
+ }
72438
+ });
72439
+ };
72440
+ };
72441
+
72391
72442
  // src/process.ts
72392
72443
  var remark = (ctx) => {
72393
72444
  const remarkPlugins = [
@@ -72420,6 +72471,7 @@ var remark = (ctx) => {
72420
72471
  remarkDirectiveMermaid_default(ctx),
72421
72472
  remarkDirectiveExcalidraw_default(ctx),
72422
72473
  remarkDirectiveStruktog_default(ctx),
72474
+ remarkDirectiveGeogebra_default(ctx),
72423
72475
  remarkCode_default(ctx),
72424
72476
  remarkMath,
72425
72477
  remarkGemoji,