cordo 2.18.0 → 2.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordo",
3
- "version": "2.18.0",
3
+ "version": "2.18.2",
4
4
  "description": "A framework for handling complex discord api interactions",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -1,11 +1,11 @@
1
- import { ButtonStyle, type APIEmoji } from "discord-api-types/v10"
2
- import { ComponentType, createComponent } from "../component"
3
- import { LibEmoji } from "../../lib/emoji"
4
- import { Hooks } from "../../core/hooks"
5
- import type { CordoFunct, CordoFunctRun } from "../../functions"
6
- import { FunctCompiler } from "../../functions/compiler"
7
- import { MaxLengthConstants } from "../../lib/constants"
8
- import { CordoMagic } from "../../core/magic"
1
+ import { ButtonStyle, type APIEmoji } from 'discord-api-types/v10'
2
+ import { ComponentType, createComponent } from '../component'
3
+ import { LibEmoji } from '../../lib/emoji'
4
+ import { Hooks } from '../../core/hooks'
5
+ import type { CordoFunct, CordoFunctRun } from '../../functions'
6
+ import { FunctCompiler } from '../../functions/compiler'
7
+ import { MaxLengthConstants } from '../../lib/constants'
8
+ import { CordoMagic } from '../../core/magic'
9
9
 
10
10
 
11
11
  export function button() {
@@ -1,9 +1,9 @@
1
- import { ComponentType, createComponent } from "../component"
2
- import { Hooks } from "../../core/hooks"
3
- import { value, type CordoFunct, type CordoFunctRun } from "../../functions"
4
- import { FunctCompiler } from "../../functions/compiler"
5
- import { MaxLengthConstants } from "../../lib/constants"
6
- import { CordoMagic } from "../../core/magic"
1
+ import { ComponentType, createComponent } from '../component'
2
+ import { Hooks } from '../../core/hooks'
3
+ import { value, type CordoFunct, type CordoFunctRun } from '../../functions'
4
+ import { FunctCompiler } from '../../functions/compiler'
5
+ import { MaxLengthConstants } from '../../lib/constants'
6
+ import { CordoMagic } from '../../core/magic'
7
7
 
8
8
 
9
9
  type CheckboxGroupOption<Value extends string = string> = ({
@@ -1,4 +1,4 @@
1
- import type { CordoComponent } from "../component"
1
+ import type { CordoComponent } from '../component'
2
2
 
3
3
 
4
4
  export function collection(...components: CordoComponent[]) {
@@ -1,5 +1,5 @@
1
- import { ComponentType, createComponent, renderComponentList, type CordoComponent } from "../component"
2
- import type { CordoModifier } from "../modifier"
1
+ import { ComponentType, createComponent, renderComponentList, type CordoComponent } from '../component'
2
+ import type { CordoModifier } from '../modifier'
3
3
 
4
4
 
5
5
  export type AllowedComponents = CordoComponent<'ActionRow' | 'Button' | 'TextDisplay' | 'Section' | 'MediaGallery' | 'Seperator' | 'File' | 'StringSelect'> | CordoModifier
@@ -1,4 +1,4 @@
1
- import { ComponentType, createComponent } from "../component"
1
+ import { ComponentType, createComponent } from '../component'
2
2
 
3
3
 
4
4
  export function divider() {
@@ -20,6 +20,6 @@ export function divider() {
20
20
  return out
21
21
  }
22
22
  }
23
-
23
+
24
24
  return out
25
25
  }
@@ -1,8 +1,8 @@
1
- import { ComponentType, createComponent } from "../component"
2
- import { Hooks } from "../../core/hooks"
3
- import { value, type CordoFunct, type CordoFunctRun } from "../../functions"
4
- import { FunctCompiler } from "../../functions/compiler"
5
- import { CordoMagic } from "../../core/magic"
1
+ import { ComponentType, createComponent } from '../component'
2
+ import { Hooks } from '../../core/hooks'
3
+ import { value, type CordoFunct, type CordoFunctRun } from '../../functions'
4
+ import { FunctCompiler } from '../../functions/compiler'
5
+ import { CordoMagic } from '../../core/magic'
6
6
 
7
7
 
8
8
  export function fileUpload() {
@@ -1,4 +1,4 @@
1
- import { ComponentType, createComponent, renderComponentList, type CordoComponent } from "../component"
1
+ import { ComponentType, createComponent, renderComponentList, type CordoComponent } from '../component'
2
2
 
3
3
 
4
4
  export function gallery(...items: CordoComponent<'Thumbnail'>[]) {
@@ -1,4 +1,4 @@
1
- import { ComponentType, createComponent } from "../component"
1
+ import { ComponentType, createComponent } from '../component'
2
2
 
3
3
 
4
4
  export function image(url: string) {
@@ -1,8 +1,8 @@
1
- import { URL } from "node:url"
2
- import { ButtonStyle } from "discord-api-types/v10"
3
- import { ComponentType, createComponent } from "../component"
4
- import { Hooks } from "../../core/hooks"
5
- import { MaxLengthConstants } from "../../lib/constants"
1
+ import { URL } from 'node:url'
2
+ import { ButtonStyle } from 'discord-api-types/v10'
3
+ import { ComponentType, createComponent } from '../component'
4
+ import { Hooks } from '../../core/hooks'
5
+ import { MaxLengthConstants } from '../../lib/constants'
6
6
 
7
7
 
8
8
  export function linkButton(url: string) {
@@ -1,9 +1,9 @@
1
- import { Hooks } from "../../core/hooks"
2
- import { CordoMagic } from "../../core/magic"
3
- import type { CordoFunct, CordoFunctRun } from "../../functions"
4
- import { FunctCompiler } from "../../functions/compiler"
5
- import { ComponentType, createComponent, renderComponent, renderComponentList, type CordoComponent, type CordoComponentPayload, type StringComponentType } from "../component"
6
- import type { CordoModifier } from "../modifier"
1
+ import { Hooks } from '../../core/hooks'
2
+ import { CordoMagic } from '../../core/magic'
3
+ import type { CordoFunct, CordoFunctRun } from '../../functions'
4
+ import { FunctCompiler } from '../../functions/compiler'
5
+ import { ComponentType, createComponent, renderComponent, renderComponentList, type CordoComponent, type CordoComponentPayload, type StringComponentType } from '../component'
6
+ import type { CordoModifier } from '../modifier'
7
7
 
8
8
 
9
9
  export type AllowedComponents = CordoComponent<'TextDisplay' | 'TextInput' | 'RoleSelect' | 'UserSelect' | 'StringSelect' | 'ChannelSelect' | 'MentionableSelect' | 'Label' | 'FileUpload' | 'RadioGroup' | 'CheckboxGroup' | 'Checkbox'> | CordoModifier
@@ -1,9 +1,9 @@
1
- import { ComponentType, createComponent } from "../component"
2
- import { Hooks } from "../../core/hooks"
3
- import { value, type CordoFunct, type CordoFunctRun } from "../../functions"
4
- import { FunctCompiler } from "../../functions/compiler"
5
- import { MaxLengthConstants } from "../../lib/constants"
6
- import { CordoMagic } from "../../core/magic"
1
+ import { ComponentType, createComponent } from '../component'
2
+ import { Hooks } from '../../core/hooks'
3
+ import { value, type CordoFunct, type CordoFunctRun } from '../../functions'
4
+ import { FunctCompiler } from '../../functions/compiler'
5
+ import { MaxLengthConstants } from '../../lib/constants'
6
+ import { CordoMagic } from '../../core/magic'
7
7
 
8
8
 
9
9
  type RadioGroupOption<Value extends string = string> = ({
@@ -1,4 +1,4 @@
1
- import { ComponentType, createComponent, renderComponentList, type CordoComponent } from "../component"
1
+ import { ComponentType, createComponent, renderComponentList, type CordoComponent } from '../component'
2
2
 
3
3
 
4
4
  type AllowedComponents = CordoComponent<'Button' | 'StringSelect'>
@@ -1,4 +1,4 @@
1
- import { ComponentType, createComponent, renderComponent, renderComponentList, type CordoComponent } from "../component"
1
+ import { ComponentType, createComponent, renderComponent, renderComponentList, type CordoComponent } from '../component'
2
2
 
3
3
 
4
4
  type AllowedComponentsContent = CordoComponent<'TextDisplay'>
@@ -1,10 +1,10 @@
1
- import { type APISelectMenuOption } from "discord-api-types/v10"
2
- import { ComponentType, createComponent } from "../component"
3
- import { Hooks } from "../../core/hooks"
4
- import { value, type CordoFunct, type CordoFunctRun } from "../../functions"
5
- import { FunctCompiler } from "../../functions/compiler"
6
- import { MaxLengthConstants } from "../../lib/constants"
7
- import { CordoMagic } from "../../core/magic"
1
+ import { type APISelectMenuOption } from 'discord-api-types/v10'
2
+ import { ComponentType, createComponent } from '../component'
3
+ import { Hooks } from '../../core/hooks'
4
+ import { value, type CordoFunct, type CordoFunctRun } from '../../functions'
5
+ import { FunctCompiler } from '../../functions/compiler'
6
+ import { MaxLengthConstants } from '../../lib/constants'
7
+ import { CordoMagic } from '../../core/magic'
8
8
 
9
9
 
10
10
  type SelectMenuOption<Value extends string = string> = Omit<APISelectMenuOption, 'value'> & ({
@@ -1,5 +1,5 @@
1
- import { ButtonStyle } from "discord-api-types/v10"
2
- import { ComponentType, createComponent } from "../component"
1
+ import { ButtonStyle } from 'discord-api-types/v10'
2
+ import { ComponentType, createComponent } from '../component'
3
3
 
4
4
 
5
5
  export function skuButton(skuId: string) {
@@ -1,4 +1,4 @@
1
- import { ComponentType, createComponent } from "../component"
1
+ import { ComponentType, createComponent } from '../component'
2
2
 
3
3
 
4
4
  export function spacer() {
@@ -20,6 +20,6 @@ export function spacer() {
20
20
  return out
21
21
  }
22
22
  }
23
-
23
+
24
24
  return out
25
25
  }
@@ -1,8 +1,8 @@
1
- import { ComponentType, createComponent } from "../component"
2
- import { Hooks } from "../../core/hooks"
3
- import { FunctCompiler } from "../../functions/compiler"
4
- import { value } from "../../functions"
5
- import { CordoMagic } from "../../core/magic"
1
+ import { ComponentType, createComponent } from '../component'
2
+ import { Hooks } from '../../core/hooks'
3
+ import { FunctCompiler } from '../../functions/compiler'
4
+ import { value } from '../../functions'
5
+ import { CordoMagic } from '../../core/magic'
6
6
 
7
7
 
8
8
  export function textInput() {
@@ -1,5 +1,5 @@
1
- import { Hooks } from "../../core/hooks"
2
- import { ComponentType, createComponent } from "../component"
1
+ import { Hooks } from '../../core/hooks'
2
+ import { ComponentType, createComponent } from '../component'
3
3
 
4
4
 
5
5
  export function text(...content: Array<string | { toString: () => string }>) {
@@ -89,6 +89,6 @@ export function text(...content: Array<string | { toString: () => string }>) {
89
89
  return out
90
90
  }
91
91
  }
92
-
92
+
93
93
  return out
94
94
  }
@@ -1,4 +1,5 @@
1
- import * as Ui from "../components"
1
+ import { container } from '../components/builtin/container'
2
+ import { text } from '../components/builtin/text'
2
3
 
3
4
 
4
5
  export class CordoError extends Error {
@@ -11,9 +12,9 @@ export class CordoError extends Error {
11
12
  }
12
13
 
13
14
  public render() {
14
- return Ui.container(
15
- Ui.text('Error:', this.name).size('h2'),
16
- Ui.text(this.message)
15
+ return container(
16
+ text('Error:', this.name).size('h2'),
17
+ text(this.message)
17
18
  )
18
19
  }
19
20