@sdeck/plugin 0.1.0 → 0.3.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/dist/bridge.d.ts CHANGED
@@ -24,7 +24,10 @@ export interface HostBridge {
24
24
  watchImages(listener: () => void): () => void;
25
25
  }
26
26
  export declare const HostBridgeContext: import("react").Context<HostBridge | undefined>;
27
- /** The value of an expression (`system.cpu > 80`, `vars.mode`), kept up to date. */
27
+ /**
28
+ * The value of an expression (`system.cpu > 80`, `vars.mode`), kept up to date. Values the plugin
29
+ * is not allowed to read (`state`, `variables`) are missing.
30
+ */
28
31
  export declare function useExpression(source: string): unknown;
29
32
  /** A `{{template}}` rendered to text, kept up to date: `useTemplate("CPU {{system.cpu}}%")`. */
30
33
  export declare function useTemplate(source: string): string;
@@ -32,7 +35,10 @@ export declare function useTemplate(source: string): string;
32
35
  export declare function useHostState(key: string): unknown;
33
36
  /** A global variable and a setter for it. */
34
37
  export declare function useVariable(name: string): [unknown, (value: unknown) => void];
35
- /** Runs another plugin's action from a component (`run("@sdeck/plugin-system", "open", {...})`). */
38
+ /**
39
+ * Runs an action from a component (`run("@sdeck/plugin-system", "open", {...})`).
40
+ * Other plugins' actions need the `actions` permission.
41
+ */
36
42
  export declare function useRunAction(): HostBridge["run"];
37
43
  /**
38
44
  * An image ready to draw with `<img src>`: an icon (`icon:lucide/play`, `icon:si/SiDiscord`) in
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAW,KAAK,KAAK,EAAuB,MAAM,eAAe,CAAC;AAYzE,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAClE,wEAAwE;IACxE,KAAK,IAAI,KAAK,CAAC;IACf,+E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
@@ -7,7 +7,9 @@ export * from "@sdeck/app";
7
7
  export { type HostBridge, HostBridgeContext, useExpression, useHostState, useImage, useRunAction, useTemplate, useVariable, } from "./bridge.ts";
8
8
  export { type ConnectionOptions, type ConnectionState, type Link, ManagedConnection, PermanentError, } from "./connection.ts";
9
9
  export { HOST_MODULES, type ManifestResult, PLUGIN_KEYWORD, type PluginManifest, parseManifest, SUPPORTED_API_VERSIONS, } from "./manifest.ts";
10
- export { type Action, type ActionDef, type ActionProps, checkPlugin, type Deactivate, type DeckControls, defineAction, definePlugin, defineTrigger, type Onboarding, type OnboardingStep, type OptionSource, PERMISSIONS, type Permission, PLUGIN_API_VERSION, type PluginCommand, type PluginContext, type PluginDef, pluginNamespace, type RunContext, type RunFn, type RunOutcome, type RunResult, type SlotKind, type StarterPage, type StateDef, type StatusLevel, type Trigger, type TriggerContext, type TriggerDef, } from "./plugin.ts";
11
- export { type BooleanField, type ColorField, checkSchema, defaultValue, type FieldValue, type ImageField, type InferSettings, isFieldVisible, type NumberField, type PageField, resolveSettings, type SecretField, type SelectField, type SelectOption, type SettingField, type SettingsSchema, type TextField, } from "./settings.ts";
10
+ export { PERMISSION_TEXTS, PERMISSIONS, type Permission, PermissionError, type PermissionText, } from "./permissions.ts";
11
+ export { type Action, type ActionDef, type ActionProps, checkPlugin, type Deactivate, type DeckControls, defineAction, definePlugin, defineTrigger, type Onboarding, type OnboardingStep, type OptionSource, type Overlay, type OverlayProps, PLUGIN_API_VERSION, type PluginCommand, type PluginContext, type PluginDef, pluginNamespace, type RunContext, type RunFn, type RunOutcome, type RunResult, type SlotKind, type StarterPage, type StateDef, type StatusLevel, type Trigger, type TriggerContext, type TriggerDef, } from "./plugin.ts";
12
+ export { type BooleanField, behaviorFields, type ColorField, checkSchema, defaultValue, type FieldValue, type GroupsField, type ImageField, type InferSettings, isFieldVisible, liveSettings, type NumberField, type OptionGroup, optionGroups, type PageField, resolveSettings, type SecretField, type SelectField, type SelectOption, type SettingField, type SettingsSchema, type SettingValue, type SlotsField, slotList, type TextField, } from "./settings.ts";
12
13
  export { Shared } from "./shared.ts";
14
+ export { fitText, layoutText, type TextLayout, type TextLayoutOptions, type TextRow, } from "./text.ts";
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,KAAK,UAAU,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,iBAAiB,EACjB,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,cAAc,EACnB,aAAa,EACb,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,UAAU,EACf,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,eAAe,EACf,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,WAAW,EACX,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,KAAK,UAAU,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,iBAAiB,EACjB,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,cAAc,EACnB,aAAa,EACb,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,KAAK,UAAU,EACf,eAAe,EACf,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,eAAe,EACf,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAA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