pantsdown 2.0.7 → 2.1.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.
package/cz-adapter.cjs ADDED
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+
3
+ // this bridge adapter as workaround for ESM version of commitlint
4
+ // https://github.com/conventional-changelog/commitlint/issues/3949
5
+
6
+ // @ts-ignore
7
+ exports.prompter = async (inquirerIns, commit) => {
8
+ (await import("@commitlint/cz-commitlint")).prompter(inquirerIns, commit);
9
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "pantsdown",
3
3
  "author": "wallpants",
4
4
  "type": "module",
5
- "version": "2.0.7",
5
+ "version": "2.1.0",
6
6
  "license": "MIT",
7
7
  "description": "Markdown to 'GitHub HTML' parser",
8
8
  "repository": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "config": {
30
30
  "commitizen": {
31
- "path": "@commitlint/cz-commitlint"
31
+ "path": "./cz-adapter.cjs"
32
32
  }
33
33
  },
34
34
  "commitlint": {
@@ -52,15 +52,16 @@
52
52
  "highlight.js": "^11.9.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@commitlint/config-conventional": "^18.6.2",
56
- "@commitlint/cz-commitlint": "^18.6.1",
57
- "@happy-dom/global-registrator": "^13.3.8",
58
- "@typescript-eslint/eslint-plugin": "^7.0.0",
59
- "@typescript-eslint/parser": "^7.0.2",
60
- "bun-types": "latest",
55
+ "@commitlint/config-conventional": "^19.0.3",
56
+ "@commitlint/cz-commitlint": "^19.0.3",
57
+ "@happy-dom/global-registrator": "^13.6.0",
58
+ "@types/bun": "^1.0.8",
59
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
60
+ "@typescript-eslint/parser": "^7.1.1",
61
61
  "commitizen": "^4.3.0",
62
- "commitlint": "^18.6.1",
63
- "eslint": "^8.56.0",
62
+ "commitlint": "^19.0.3",
63
+ "eslint": "^8.57.0",
64
+ "inquirer": "^9.2.15",
64
65
  "prettier": "^3.2.5",
65
66
  "prettier-plugin-organize-imports": "^3.2.4",
66
67
  "semantic-release": "^23.0.2",
@@ -155,6 +155,18 @@
155
155
  color: var(--color-attention-fg);
156
156
  }
157
157
 
158
+ .pantsdown .markdown-alert-tip {
159
+ border-color: var(--color-success-fg);
160
+ }
161
+ .pantsdown .markdown-alert-tip span {
162
+ color: var(--color-success-fg);
163
+ }
164
+ .pantsdown .markdown-alert-caution {
165
+ border-color: var(--color-danger-fg);
166
+ }
167
+ .pantsdown .markdown-alert-caution span {
168
+ color: var(--color-danger-fg);
169
+ }
158
170
  .pantsdown .copy-button {
159
171
  position: absolute;
160
172
  left: calc(100% - 36px);
package/src/types.ts CHANGED
@@ -29,7 +29,7 @@ export interface Tokens extends Record<string, BaseToken> {
29
29
  text: string;
30
30
  icon: string;
31
31
  tokens: Token[];
32
- variant: "Note" | "Important" | "Warning";
32
+ variant: "Note" | "Important" | "Warning" | "Tip" | "Caution";
33
33
  };
34
34
  Heading: {
35
35
  type: "heading";
package/src/utils.ts CHANGED
@@ -297,4 +297,14 @@ export const ALERTS = [
297
297
  regex: makeAlertRegex("Warning"),
298
298
  icon: '<svg class="octicon octicon-alert" style="margin-right: 0.5rem;" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>',
299
299
  },
300
+ {
301
+ variant: "Tip",
302
+ regex: makeAlertRegex("Tip"),
303
+ icon: '<svg class="octicon octicon-alert" style="margin-right: 0.5rem;" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"/></svg>',
304
+ },
305
+ {
306
+ variant: "Caution",
307
+ regex: makeAlertRegex("Caution"),
308
+ icon: '<svg class="octicon octicon-alert" style="margin-right: 0.5rem;" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/></svg>',
309
+ },
300
310
  ];
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "target": "ESNext",
6
6
  "moduleResolution": "Bundler",
7
7
  "moduleDetection": "force",
8
- "types": ["bun-types"],
9
8
  "allowImportingTsExtensions": true,
10
9
  "noEmit": true,
11
10
  "composite": true,