@seedcord/kit 0.2.0-next.1 → 0.2.0-next.2

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/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  <p align="center">
2
- <img src="https://cdn.seedcord.org/assets/banner.webp" alt="seedcord" width="100%" />
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn.seedcord.org/assets/wordmark-dark.webp" />
4
+ <img src="https://cdn.seedcord.org/assets/wordmark-light.webp" alt="seedcord" width="440" />
5
+ </picture>
3
6
  </p>
4
7
 
5
8
  ---
package/dist/index.cjs CHANGED
@@ -99,7 +99,7 @@ function paginate(items, page, perPage) {
99
99
  //#endregion
100
100
  //#region src/index.ts
101
101
  /** Package version */
102
- const version = "0.2.0-next.1";
102
+ const version = "0.2.0-next.2";
103
103
 
104
104
  //#endregion
105
105
  exports.BuilderComponent = require_CustomId.BuilderComponent;
package/dist/index.mjs CHANGED
@@ -98,7 +98,7 @@ function paginate(items, page, perPage) {
98
98
  //#endregion
99
99
  //#region src/index.ts
100
100
  /** Package version */
101
- const version = "0.2.0-next.1";
101
+ const version = "0.2.0-next.2";
102
102
 
103
103
  //#endregion
104
104
  export { BuilderComponent, CustomId, Fault, Notice, RowComponent, Silence, paginate, version };
@@ -6,7 +6,7 @@ const PAGE_MAX = 1e6;
6
6
  const SLOT_MAX = 4;
7
7
  /** Build the page cursor for a paginator. */
8
8
  function pageCursor(prefix) {
9
- return new require_CustomId.CustomId(prefix).int("page", 0, PAGE_MAX).int("slot", 0, 4);
9
+ return new require_CustomId.CustomId(prefix).int("page", 0, PAGE_MAX).int("slot", 0, SLOT_MAX);
10
10
  }
11
11
 
12
12
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"internal.index.cjs","names":["CustomId"],"sources":["../src/pagination/cursor.ts","../src/customId/routing.ts"],"sourcesContent":["import { CustomId } from '@customId/CustomId';\n\nimport type { CustomIdField } from '@customId/Field';\n\n// Included in the layout hash so it is fixed per prefix. Reducing it marks every active button as StaleCustomId.\n// @internal\nexport const PAGE_MAX = 1_000_000;\n\n// Discord rejects a message with duplicate custom_ids, and two controls can target the same page (first and\n// prev both hit 0), so each control uses a distinct slot.\n// @internal\nexport const SLOT_MAX = 4;\n\n/** Page cursor for a paginator. */\nexport type PageCursor<Prefix extends string> = CustomId<\n Prefix,\n { page: CustomIdField<number>; slot: CustomIdField<number> }\n>;\n\n/** Build the page cursor for a paginator. */\nexport function pageCursor<Prefix extends string>(prefix: Prefix): PageCursor<Prefix> {\n return new CustomId(prefix).int('page', 0, PAGE_MAX).int('slot', 0, SLOT_MAX);\n}\n","import type { AnyCustomId } from './CustomId';\n\n/**\n * The route decorators store a handler's customId definitions here so the component base can decode\n * against them at runtime.\n *\n * @internal\n */\nexport const ComponentDefsKey = Symbol('seedcord:customId:componentDefs');\n\n/**\n * The phantom a component handler base carries. A route decorator constrains its argument to this, so\n * passing different definitions to the decorator and the handler's generic is a compile error. Never set at runtime.\n *\n * @internal\n */\nexport interface HasComponentDefs<Defs extends readonly AnyCustomId[]> {\n readonly __componentDefs?: Defs;\n}\n"],"mappings":";;;;AAMA,MAAa,WAAW;AAKxB,MAAa,WAAW;;AASxB,SAAgB,WAAkC,QAAoC;CAClF,OAAO,IAAIA,0BAAS,MAAM,CAAC,CAAC,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,IAAI,QAAQ,IAAW;AAChF;;;;;;;;;;ACdA,MAAa,mBAAmB,OAAO,iCAAiC"}
1
+ {"version":3,"file":"internal.index.cjs","names":["CustomId"],"sources":["../src/pagination/cursor.ts","../src/customId/routing.ts"],"sourcesContent":["import { CustomId } from '@customId/CustomId';\n\nimport type { CustomIdField } from '@customId/Field';\n\n// Included in the layout hash so it is fixed per prefix. Reducing it marks every active button as StaleCustomId.\n// @internal\nexport const PAGE_MAX = 1_000_000;\n\n// Discord rejects a message with duplicate custom_ids, and two controls can target the same page (first and\n// prev both hit 0), so each control uses a distinct slot.\n// @internal\nconst SLOT_MAX = 4;\n\n/** Page cursor for a paginator. */\nexport type PageCursor<Prefix extends string> = CustomId<\n Prefix,\n { page: CustomIdField<number>; slot: CustomIdField<number> }\n>;\n\n/** Build the page cursor for a paginator. */\nexport function pageCursor<Prefix extends string>(prefix: Prefix): PageCursor<Prefix> {\n return new CustomId(prefix).int('page', 0, PAGE_MAX).int('slot', 0, SLOT_MAX);\n}\n","import type { AnyCustomId } from './CustomId';\n\n/**\n * The route decorators store a handler's customId definitions here so the component base can decode\n * against them at runtime.\n *\n * @internal\n */\nexport const ComponentDefsKey = Symbol('seedcord:customId:componentDefs');\n\n/**\n * The phantom a component handler base carries. A route decorator constrains its argument to this, so\n * passing different definitions to the decorator and the handler's generic is a compile error. Never set at runtime.\n *\n * @internal\n */\nexport interface HasComponentDefs<Defs extends readonly AnyCustomId[]> {\n readonly __componentDefs?: Defs;\n}\n"],"mappings":";;;;AAMA,MAAa,WAAW;AAKxB,MAAM,WAAW;;AASjB,SAAgB,WAAkC,QAAoC;CAClF,OAAO,IAAIA,0BAAS,MAAM,CAAC,CAAC,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,IAAI,QAAQ,GAAG,QAAQ;AAChF;;;;;;;;;;ACdA,MAAa,mBAAmB,OAAO,iCAAiC"}
@@ -5,7 +5,7 @@ const PAGE_MAX = 1e6;
5
5
  const SLOT_MAX = 4;
6
6
  /** Build the page cursor for a paginator. */
7
7
  function pageCursor(prefix) {
8
- return new CustomId(prefix).int("page", 0, PAGE_MAX).int("slot", 0, 4);
8
+ return new CustomId(prefix).int("page", 0, PAGE_MAX).int("slot", 0, SLOT_MAX);
9
9
  }
10
10
 
11
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"internal.index.mjs","names":[],"sources":["../src/pagination/cursor.ts","../src/customId/routing.ts"],"sourcesContent":["import { CustomId } from '@customId/CustomId';\n\nimport type { CustomIdField } from '@customId/Field';\n\n// Included in the layout hash so it is fixed per prefix. Reducing it marks every active button as StaleCustomId.\n// @internal\nexport const PAGE_MAX = 1_000_000;\n\n// Discord rejects a message with duplicate custom_ids, and two controls can target the same page (first and\n// prev both hit 0), so each control uses a distinct slot.\n// @internal\nexport const SLOT_MAX = 4;\n\n/** Page cursor for a paginator. */\nexport type PageCursor<Prefix extends string> = CustomId<\n Prefix,\n { page: CustomIdField<number>; slot: CustomIdField<number> }\n>;\n\n/** Build the page cursor for a paginator. */\nexport function pageCursor<Prefix extends string>(prefix: Prefix): PageCursor<Prefix> {\n return new CustomId(prefix).int('page', 0, PAGE_MAX).int('slot', 0, SLOT_MAX);\n}\n","import type { AnyCustomId } from './CustomId';\n\n/**\n * The route decorators store a handler's customId definitions here so the component base can decode\n * against them at runtime.\n *\n * @internal\n */\nexport const ComponentDefsKey = Symbol('seedcord:customId:componentDefs');\n\n/**\n * The phantom a component handler base carries. A route decorator constrains its argument to this, so\n * passing different definitions to the decorator and the handler's generic is a compile error. Never set at runtime.\n *\n * @internal\n */\nexport interface HasComponentDefs<Defs extends readonly AnyCustomId[]> {\n readonly __componentDefs?: Defs;\n}\n"],"mappings":";;;AAMA,MAAa,WAAW;AAKxB,MAAa,WAAW;;AASxB,SAAgB,WAAkC,QAAoC;CAClF,OAAO,IAAI,SAAS,MAAM,CAAC,CAAC,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,IAAI,QAAQ,IAAW;AAChF;;;;;;;;;;ACdA,MAAa,mBAAmB,OAAO,iCAAiC"}
1
+ {"version":3,"file":"internal.index.mjs","names":[],"sources":["../src/pagination/cursor.ts","../src/customId/routing.ts"],"sourcesContent":["import { CustomId } from '@customId/CustomId';\n\nimport type { CustomIdField } from '@customId/Field';\n\n// Included in the layout hash so it is fixed per prefix. Reducing it marks every active button as StaleCustomId.\n// @internal\nexport const PAGE_MAX = 1_000_000;\n\n// Discord rejects a message with duplicate custom_ids, and two controls can target the same page (first and\n// prev both hit 0), so each control uses a distinct slot.\n// @internal\nconst SLOT_MAX = 4;\n\n/** Page cursor for a paginator. */\nexport type PageCursor<Prefix extends string> = CustomId<\n Prefix,\n { page: CustomIdField<number>; slot: CustomIdField<number> }\n>;\n\n/** Build the page cursor for a paginator. */\nexport function pageCursor<Prefix extends string>(prefix: Prefix): PageCursor<Prefix> {\n return new CustomId(prefix).int('page', 0, PAGE_MAX).int('slot', 0, SLOT_MAX);\n}\n","import type { AnyCustomId } from './CustomId';\n\n/**\n * The route decorators store a handler's customId definitions here so the component base can decode\n * against them at runtime.\n *\n * @internal\n */\nexport const ComponentDefsKey = Symbol('seedcord:customId:componentDefs');\n\n/**\n * The phantom a component handler base carries. A route decorator constrains its argument to this, so\n * passing different definitions to the decorator and the handler's generic is a compile error. Never set at runtime.\n *\n * @internal\n */\nexport interface HasComponentDefs<Defs extends readonly AnyCustomId[]> {\n readonly __componentDefs?: Defs;\n}\n"],"mappings":";;;AAMA,MAAa,WAAW;AAKxB,MAAM,WAAW;;AASjB,SAAgB,WAAkC,QAAoC;CAClF,OAAO,IAAI,SAAS,MAAM,CAAC,CAAC,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,IAAI,QAAQ,GAAG,QAAQ;AAChF;;;;;;;;;;ACdA,MAAa,mBAAmB,OAAO,iCAAiC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seedcord/kit",
3
3
  "type": "module",
4
- "version": "0.2.0-next.1",
4
+ "version": "0.2.0-next.2",
5
5
  "description": "Reusable Seedcord building blocks: component builders, the Notice error tree, and the typed customId codec",
6
6
  "repository": {
7
7
  "type": "git",
@@ -69,5 +69,5 @@
69
69
  "test:watch": "vitest dev",
70
70
  "coverage": "vitest run --coverage"
71
71
  },
72
- "readme": "<p align=\"center\">\n <img src=\"https://cdn.seedcord.org/assets/banner.webp\" alt=\"seedcord\" width=\"100%\" />\n</p>\n\n---\n\n_This repository is a work in progress._\n\n- There are no stable releases yet but changes are being made actively.\n- Until a major v1.0.0 release for seedcord, expect breaking changes in minor versions.\n- Documentation will come soon as well!\n\nIf you'd like to try it out, you can check out the code in `mock`\n"
72
+ "readme": "<p align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.seedcord.org/assets/wordmark-dark.webp\" />\n <img src=\"https://cdn.seedcord.org/assets/wordmark-light.webp\" alt=\"seedcord\" width=\"440\" />\n </picture>\n</p>\n\n---\n\n_This repository is a work in progress._\n\n- There are no stable releases yet but changes are being made actively.\n- Until a major v1.0.0 release for seedcord, expect breaking changes in minor versions.\n- Documentation will come soon as well!\n\nIf you'd like to try it out, you can check out the code in `mock`\n"
73
73
  }