@canopycanopycanopy/b-ber-grammar-logo 3.0.8-next.61 → 3.0.8-next.96

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,17 @@
1
+ //#region src/index.d.ts
2
+ declare const _default: {
3
+ plugin: (md: any, name: string, options?: any) => void;
4
+ name: string;
5
+ renderer: ({
6
+ context
7
+ }: {
8
+ context: any;
9
+ }) => {
10
+ marker: string;
11
+ minMarkers: number;
12
+ validate(params: any): any;
13
+ render(tokens: any, index: any): string;
14
+ };
15
+ };
16
+ export = _default;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":""}
package/dist/index.js CHANGED
@@ -1,52 +1,67 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
10
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
11
- var _fsExtra = _interopRequireDefault(require("fs-extra"));
12
- var _State = _interopRequireDefault(require("@canopycanopycanopy/b-ber-lib/State"));
13
- var _bBerLogger = _interopRequireDefault(require("@canopycanopycanopy/b-ber-logger"));
14
- var _bBerShapesDirectives = require("@canopycanopycanopy/b-ber-shapes-directives");
15
- var _bBerParserFigure = _interopRequireDefault(require("@canopycanopycanopy/b-ber-parser-figure"));
16
- var _bBerGrammarAttributes = require("@canopycanopycanopy/b-ber-grammar-attributes");
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ let _canopycanopycanopy_b_ber_grammar_attributes = require("@canopycanopycanopy/b-ber-grammar-attributes");
24
+ let _canopycanopycanopy_b_ber_lib = require("@canopycanopycanopy/b-ber-lib");
25
+ let _canopycanopycanopy_b_ber_logger = require("@canopycanopycanopy/b-ber-logger");
26
+ _canopycanopycanopy_b_ber_logger = __toESM(_canopycanopycanopy_b_ber_logger);
27
+ let _canopycanopycanopy_b_ber_parser_figure = require("@canopycanopycanopy/b-ber-parser-figure");
28
+ _canopycanopycanopy_b_ber_parser_figure = __toESM(_canopycanopycanopy_b_ber_parser_figure);
29
+ let _canopycanopycanopy_b_ber_shapes_directives = require("@canopycanopycanopy/b-ber-shapes-directives");
30
+ let fs_extra = require("fs-extra");
31
+ fs_extra = __toESM(fs_extra);
32
+ //#region src/index.ts
17
33
  const MARKER_RE = /^logo/;
18
34
  const DIRECTIVE_RE = /(logo)(?::([^\s]+)(\s?.*)?)?$/;
19
- var _default = exports.default = {
20
- plugin: _bBerParserFigure.default,
21
- name: 'logo',
22
- renderer: ({
23
- context
24
- }) => ({
25
- marker: _bBerShapesDirectives.INLINE_DIRECTIVE_MARKER,
26
- minMarkers: _bBerShapesDirectives.INLINE_DIRECTIVE_MARKER_MIN_LENGTH,
27
- validate(params) {
28
- return (0, _trim.default)(params).call(params).match(MARKER_RE);
29
- },
30
- render(tokens, index) {
31
- var _context;
32
- const match = (0, _trim.default)(_context = tokens[index].info).call(_context).match(DIRECTIVE_RE);
33
- if (!match) return '';
34
- const fileName = `_markdown/${context.fileName}.md`;
35
- const lineNumber = (0, _map.default)(tokens[index]) ? (0, _map.default)(tokens[index])[0] : null;
36
- const [, type, id, attrs] = match;
37
- const attrsObj = (0, _bBerGrammarAttributes.attributesObject)(attrs, type, {
38
- fileName,
39
- lineNumber
40
- });
41
- if (!attrsObj.source) _bBerLogger.default.error('[source] attribute is required by [logo] directive, aborting');
42
- const inputImagePath = _State.default.src.images(attrsObj.source);
43
- const outputImagePath = `../images/${attrsObj.source}`;
44
- if (!_fsExtra.default.existsSync(inputImagePath)) _bBerLogger.default.warn(`Image [${attrsObj.source}] does not exist`);
45
- delete attrsObj.source; // since we need the path relative to `images`
46
- const attrString = (0, _bBerGrammarAttributes.attributesString)(attrsObj, type);
47
- return `<figure id="${(0, _bBerGrammarAttributes.htmlId)(id)}" class="logo">
35
+ var src_default = {
36
+ plugin: _canopycanopycanopy_b_ber_parser_figure.default,
37
+ name: "logo",
38
+ renderer: ({ context }) => ({
39
+ marker: _canopycanopycanopy_b_ber_shapes_directives.INLINE_DIRECTIVE_MARKER,
40
+ minMarkers: _canopycanopycanopy_b_ber_shapes_directives.INLINE_DIRECTIVE_MARKER_MIN_LENGTH,
41
+ validate(params) {
42
+ return params.trim().match(MARKER_RE);
43
+ },
44
+ render(tokens, index) {
45
+ const match = tokens[index].info.trim().match(DIRECTIVE_RE);
46
+ if (!match) return "";
47
+ const fileName = `_markdown/${context.fileName}.md`;
48
+ const lineNumber = tokens[index].map ? tokens[index].map[0] : null;
49
+ const [, type, id, attrs] = match;
50
+ const attrsObj = (0, _canopycanopycanopy_b_ber_grammar_attributes.attributesObject)(attrs, type, {
51
+ fileName,
52
+ lineNumber
53
+ });
54
+ if (!attrsObj.source) _canopycanopycanopy_b_ber_logger.default.error("[source] attribute is required by [logo] directive, aborting");
55
+ const inputImagePath = _canopycanopycanopy_b_ber_lib.State.src.images(attrsObj.source);
56
+ const outputImagePath = `../images/${attrsObj.source}`;
57
+ if (!fs_extra.default.existsSync(inputImagePath)) _canopycanopycanopy_b_ber_logger.default.warn(`Image [${attrsObj.source}] does not exist`);
58
+ delete attrsObj.source;
59
+ const attrString = (0, _canopycanopycanopy_b_ber_grammar_attributes.attributesString)(attrsObj, type);
60
+ return `<figure id="${(0, _canopycanopycanopy_b_ber_grammar_attributes.htmlId)(id)}" class="logo">
48
61
  <img style="width:120px;" src="${outputImagePath}" ${attrString}/>
49
62
  </figure>`;
50
- }
51
- })
52
- };
63
+ }
64
+ })
65
+ };
66
+ //#endregion
67
+ module.exports = src_default;
package/package.json CHANGED
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "name": "@canopycanopycanopy/b-ber-grammar-logo",
3
- "version": "3.0.8-next.61+2bbec564",
3
+ "version": "3.0.8-next.96+7446845b",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
- "prepare:dist": "BABEL_ENV=production babel --config-file ../../babel.config.js -d dist/ src/ --ignore **/__tests__/**",
8
- "clean": "rimraf dist",
9
- "prepare": "npm run clean && npm run prepare:dist",
10
- "build": "npm run prepare",
11
- "watch": "BABEL_ENV=production babel --config-file ../../babel.config.js -d dist/ src/ --watch src",
7
+ "build": "tsdown",
8
+ "typecheck": "tsc --noEmit",
12
9
  "test": "jest"
13
10
  },
14
11
  "author": "Triple Canopy <b-ber@canopycanopycanopy.com> (https://triplecanopy.github.io/)",
@@ -17,19 +14,19 @@
17
14
  "access": "public"
18
15
  },
19
16
  "devDependencies": {
20
- "@babel/cli": "^7.10.5",
21
- "@babel/core": "^7.10.5",
22
- "@babel/preset-env": "^7.10.4",
23
- "browserslist": "^4.17.4",
24
- "jest": "^26.6.3",
25
- "rimraf": "^2.7.1"
17
+ "@swc/core": "^1.15.40",
18
+ "@swc/jest": "^0.2.39",
19
+ "jest": "^29.7.0",
20
+ "rimraf": "^2.7.1",
21
+ "tsdown": "^0.22.1",
22
+ "typescript": "^6.0.3"
26
23
  },
27
24
  "dependencies": {
28
- "@canopycanopycanopy/b-ber-grammar-attributes": "3.0.8-next.61+2bbec564",
29
- "@canopycanopycanopy/b-ber-lib": "3.0.8-next.61+2bbec564",
30
- "@canopycanopycanopy/b-ber-logger": "3.0.8-next.61+2bbec564",
31
- "@canopycanopycanopy/b-ber-parser-figure": "3.0.8-next.61+2bbec564",
32
- "@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-next.61+2bbec564",
25
+ "@canopycanopycanopy/b-ber-grammar-attributes": "3.0.8-next.96+7446845b",
26
+ "@canopycanopycanopy/b-ber-lib": "3.0.8-next.96+7446845b",
27
+ "@canopycanopycanopy/b-ber-logger": "3.0.8-next.96+7446845b",
28
+ "@canopycanopycanopy/b-ber-parser-figure": "3.0.8-next.96+7446845b",
29
+ "@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-next.96+7446845b",
33
30
  "fs-extra": "^8.1.0",
34
31
  "lodash": "^4.17.21",
35
32
  "tar": "^6.1.11"
@@ -51,5 +48,6 @@
51
48
  "url": "https://maxwellsimmer.com"
52
49
  }
53
50
  ],
54
- "gitHead": "2bbec5643278f53becb0d2ba1f55edfe379d5587"
51
+ "gitHead": "7446845bcda4337bfbc9f75b55a1e0ca805023eb",
52
+ "types": "dist/index.d.ts"
55
53
  }