@mostfeatured/dbi 0.1.47 → 0.2.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/src/DBI.d.ts.map +1 -0
- package/dist/src/DBI.js.map +1 -0
- package/dist/src/Events.d.ts.map +1 -0
- package/dist/src/Events.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/methods/handleMessageCommands.d.ts.map +1 -0
- package/dist/src/methods/handleMessageCommands.js.map +1 -0
- package/dist/src/methods/hookEventListeners.d.ts.map +1 -0
- package/dist/src/methods/hookEventListeners.js.map +1 -0
- package/dist/src/methods/hookInteractionListeners.d.ts.map +1 -0
- package/dist/{methods → src/methods}/hookInteractionListeners.js +22 -12
- package/dist/src/methods/hookInteractionListeners.js.map +1 -0
- package/dist/src/methods/publishInteractions.d.ts.map +1 -0
- package/dist/src/methods/publishInteractions.js.map +1 -0
- package/dist/src/types/ApplicationRoleConnectionMetadata.d.ts.map +1 -0
- package/dist/src/types/ApplicationRoleConnectionMetadata.js.map +1 -0
- package/dist/src/types/Builders/ButtonBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/ButtonBuilder.js.map +1 -0
- package/dist/src/types/Builders/ChannelSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/ChannelSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/MentionableSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/MentionableSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/ModalBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/ModalBuilder.js.map +1 -0
- package/dist/src/types/Builders/RoleSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/RoleSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/StringSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/StringSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/UserSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/UserSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/ChatInput/ChatInput.d.ts.map +1 -0
- package/dist/src/types/ChatInput/ChatInput.js.map +1 -0
- package/dist/{types → src/types}/ChatInput/ChatInputOptions.d.ts +2 -2
- package/dist/src/types/ChatInput/ChatInputOptions.d.ts.map +1 -0
- package/dist/src/types/ChatInput/ChatInputOptions.js.map +1 -0
- package/dist/src/types/Components/Button.d.ts.map +1 -0
- package/dist/src/types/Components/Button.js.map +1 -0
- package/dist/src/types/Components/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/ChannelSelectMenu.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.d.ts +91 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.js +300 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/parser.d.ts.map +1 -0
- package/dist/{types → src/types}/Components/HTMLComponentsV2/parser.js +11 -4
- package/dist/src/types/Components/HTMLComponentsV2/parser.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.d.ts +35 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.js +822 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.d.ts +24 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.js +294 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.js.map +1 -0
- package/dist/src/types/Components/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/MentionableSelectMenu.js.map +1 -0
- package/dist/src/types/Components/Modal.d.ts.map +1 -0
- package/dist/src/types/Components/Modal.js.map +1 -0
- package/dist/src/types/Components/RoleSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/RoleSelectMenu.js.map +1 -0
- package/dist/src/types/Components/StringSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/StringSelectMenu.js.map +1 -0
- package/dist/src/types/Components/UserSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/UserSelectMenu.js.map +1 -0
- package/dist/src/types/Event.d.ts.map +1 -0
- package/dist/src/types/Event.js.map +1 -0
- package/dist/src/types/Interaction.d.ts.map +1 -0
- package/dist/src/types/Interaction.js.map +1 -0
- package/dist/src/types/other/CustomEvent.d.ts.map +1 -0
- package/dist/src/types/other/CustomEvent.js.map +1 -0
- package/dist/src/types/other/FakeMessageInteraction.d.ts.map +1 -0
- package/dist/src/types/other/FakeMessageInteraction.js.map +1 -0
- package/dist/src/types/other/InteractionLocale.d.ts.map +1 -0
- package/dist/src/types/other/InteractionLocale.js.map +1 -0
- package/dist/src/types/other/Locale.d.ts.map +1 -0
- package/dist/src/types/other/Locale.js.map +1 -0
- package/dist/src/types/other/MessageContextMenu.d.ts.map +1 -0
- package/dist/src/types/other/MessageContextMenu.js.map +1 -0
- package/dist/src/types/other/UserContextMenu.d.ts.map +1 -0
- package/dist/src/types/other/UserContextMenu.js.map +1 -0
- package/dist/src/utils/MemoryStore.d.ts.map +1 -0
- package/dist/src/utils/MemoryStore.js.map +1 -0
- package/dist/src/utils/UtilTypes.d.ts.map +1 -0
- package/dist/src/utils/UtilTypes.js.map +1 -0
- package/dist/src/utils/customId.d.ts.map +1 -0
- package/dist/src/utils/customId.js.map +1 -0
- package/dist/src/utils/permissions.d.ts.map +1 -0
- package/dist/src/utils/permissions.js.map +1 -0
- package/dist/src/utils/recursiveImport.d.ts.map +1 -0
- package/dist/src/utils/recursiveImport.js.map +1 -0
- package/dist/src/utils/recursiveUnload.d.ts.map +1 -0
- package/dist/src/utils/recursiveUnload.js.map +1 -0
- package/dist/src/utils/unloadModule.d.ts.map +1 -0
- package/dist/src/utils/unloadModule.js.map +1 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +103 -0
- package/dist/test/index.js.map +1 -0
- package/docs/ADVANCED_FEATURES.md +836 -0
- package/docs/API_REFERENCE.md +925 -0
- package/docs/CHAT_INPUT.md +807 -0
- package/docs/COMPONENTS.md +1035 -0
- package/docs/EVENTS.md +564 -0
- package/docs/GETTING_STARTED.md +394 -0
- package/docs/LOCALIZATION.md +773 -0
- package/docs/README.md +341 -0
- package/docs/SVELTE_COMPONENTS.md +955 -0
- package/generated/globals.d.ts +1 -0
- package/generated/index.d.ts +30 -0
- package/generated/svelte-dbi.d.ts +588 -0
- package/package.json +57 -47
- package/readme.md +168 -491
- package/src/methods/hookInteractionListeners.ts +23 -12
- package/src/types/Components/HTMLComponentsV2/index.ts +353 -12
- package/src/types/Components/HTMLComponentsV2/parser.ts +14 -4
- package/src/types/Components/HTMLComponentsV2/svelteParser.ts +904 -0
- package/src/types/Components/HTMLComponentsV2/svelteRenderer.ts +332 -0
- package/test/index.ts +105 -0
- package/test/product-showcase.svelte +199 -0
- package/tsconfig.json +13 -3
- package/dist/DBI.d.ts.map +0 -1
- package/dist/DBI.js.map +0 -1
- package/dist/Events.d.ts.map +0 -1
- package/dist/Events.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/methods/handleMessageCommands.d.ts.map +0 -1
- package/dist/methods/handleMessageCommands.js.map +0 -1
- package/dist/methods/hookEventListeners.d.ts.map +0 -1
- package/dist/methods/hookEventListeners.js.map +0 -1
- package/dist/methods/hookInteractionListeners.d.ts.map +0 -1
- package/dist/methods/hookInteractionListeners.js.map +0 -1
- package/dist/methods/publishInteractions.d.ts.map +0 -1
- package/dist/methods/publishInteractions.js.map +0 -1
- package/dist/types/ApplicationRoleConnectionMetadata.d.ts.map +0 -1
- package/dist/types/ApplicationRoleConnectionMetadata.js.map +0 -1
- package/dist/types/Builders/ButtonBuilder.d.ts.map +0 -1
- package/dist/types/Builders/ButtonBuilder.js.map +0 -1
- package/dist/types/Builders/ChannelSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/ChannelSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/MentionableSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/MentionableSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/ModalBuilder.d.ts.map +0 -1
- package/dist/types/Builders/ModalBuilder.js.map +0 -1
- package/dist/types/Builders/RoleSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/RoleSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/StringSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/StringSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/UserSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/UserSelectMenuBuilder.js.map +0 -1
- package/dist/types/ChatInput/ChatInput.d.ts.map +0 -1
- package/dist/types/ChatInput/ChatInput.js.map +0 -1
- package/dist/types/ChatInput/ChatInputOptions.d.ts.map +0 -1
- package/dist/types/ChatInput/ChatInputOptions.js.map +0 -1
- package/dist/types/Components/Button.d.ts.map +0 -1
- package/dist/types/Components/Button.js.map +0 -1
- package/dist/types/Components/ChannelSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/ChannelSelectMenu.js.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/index.d.ts +0 -19
- package/dist/types/Components/HTMLComponentsV2/index.d.ts.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/index.js +0 -31
- package/dist/types/Components/HTMLComponentsV2/index.js.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/parser.d.ts.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/parser.js.map +0 -1
- package/dist/types/Components/MentionableSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/MentionableSelectMenu.js.map +0 -1
- package/dist/types/Components/Modal.d.ts.map +0 -1
- package/dist/types/Components/Modal.js.map +0 -1
- package/dist/types/Components/RoleSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/RoleSelectMenu.js.map +0 -1
- package/dist/types/Components/StringSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/StringSelectMenu.js.map +0 -1
- package/dist/types/Components/UserSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/UserSelectMenu.js.map +0 -1
- package/dist/types/Event.d.ts.map +0 -1
- package/dist/types/Event.js.map +0 -1
- package/dist/types/Interaction.d.ts.map +0 -1
- package/dist/types/Interaction.js.map +0 -1
- package/dist/types/other/CustomEvent.d.ts.map +0 -1
- package/dist/types/other/CustomEvent.js.map +0 -1
- package/dist/types/other/FakeMessageInteraction.d.ts.map +0 -1
- package/dist/types/other/FakeMessageInteraction.js.map +0 -1
- package/dist/types/other/InteractionLocale.d.ts.map +0 -1
- package/dist/types/other/InteractionLocale.js.map +0 -1
- package/dist/types/other/Locale.d.ts.map +0 -1
- package/dist/types/other/Locale.js.map +0 -1
- package/dist/types/other/MessageContextMenu.d.ts.map +0 -1
- package/dist/types/other/MessageContextMenu.js.map +0 -1
- package/dist/types/other/UserContextMenu.d.ts.map +0 -1
- package/dist/types/other/UserContextMenu.js.map +0 -1
- package/dist/utils/MemoryStore.d.ts.map +0 -1
- package/dist/utils/MemoryStore.js.map +0 -1
- package/dist/utils/UtilTypes.d.ts.map +0 -1
- package/dist/utils/UtilTypes.js.map +0 -1
- package/dist/utils/customId.d.ts.map +0 -1
- package/dist/utils/customId.js.map +0 -1
- package/dist/utils/permissions.d.ts.map +0 -1
- package/dist/utils/permissions.js.map +0 -1
- package/dist/utils/recursiveImport.d.ts.map +0 -1
- package/dist/utils/recursiveImport.js.map +0 -1
- package/dist/utils/recursiveUnload.d.ts.map +0 -1
- package/dist/utils/recursiveUnload.js.map +0 -1
- package/dist/utils/unloadModule.d.ts.map +0 -1
- package/dist/utils/unloadModule.js.map +0 -1
- package/examples/modal/dbi.js +0 -30
- package/examples/modal/login.js +0 -15
- package/examples/modal/package.json +0 -15
- package/examples/modal/publish.js +0 -13
- package/examples/modal/src/chatInput.js +0 -38
- package/examples/modal/src/components.js +0 -33
- package/examples/modal/src/event.js +0 -20
- package/examples/modal/src/interactionlocales.js +0 -24
- package/examples/modal/src/locales.js +0 -38
- package/examples/modal/src/modal.js +0 -28
- /package/dist/{DBI.d.ts → src/DBI.d.ts} +0 -0
- /package/dist/{DBI.js → src/DBI.js} +0 -0
- /package/dist/{Events.d.ts → src/Events.d.ts} +0 -0
- /package/dist/{Events.js → src/Events.js} +0 -0
- /package/dist/{data → src/data}/eventMap.json +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{methods → src/methods}/handleMessageCommands.d.ts +0 -0
- /package/dist/{methods → src/methods}/handleMessageCommands.js +0 -0
- /package/dist/{methods → src/methods}/hookEventListeners.d.ts +0 -0
- /package/dist/{methods → src/methods}/hookEventListeners.js +0 -0
- /package/dist/{methods → src/methods}/hookInteractionListeners.d.ts +0 -0
- /package/dist/{methods → src/methods}/publishInteractions.d.ts +0 -0
- /package/dist/{methods → src/methods}/publishInteractions.js +0 -0
- /package/dist/{types → src/types}/ApplicationRoleConnectionMetadata.d.ts +0 -0
- /package/dist/{types → src/types}/ApplicationRoleConnectionMetadata.js +0 -0
- /package/dist/{types → src/types}/Builders/ButtonBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/ButtonBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/ChannelSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/ChannelSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/MentionableSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/MentionableSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/ModalBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/ModalBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/RoleSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/RoleSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/StringSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/StringSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/UserSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/UserSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/ChatInput/ChatInput.d.ts +0 -0
- /package/dist/{types → src/types}/ChatInput/ChatInput.js +0 -0
- /package/dist/{types → src/types}/ChatInput/ChatInputOptions.js +0 -0
- /package/dist/{types → src/types}/Components/Button.d.ts +0 -0
- /package/dist/{types → src/types}/Components/Button.js +0 -0
- /package/dist/{types → src/types}/Components/ChannelSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/ChannelSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts +0 -0
- /package/dist/{types → src/types}/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js +0 -0
- /package/dist/{types → src/types}/Components/HTMLComponentsV2/parser.d.ts +0 -0
- /package/dist/{types → src/types}/Components/MentionableSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/MentionableSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/Modal.d.ts +0 -0
- /package/dist/{types → src/types}/Components/Modal.js +0 -0
- /package/dist/{types → src/types}/Components/RoleSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/RoleSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/StringSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/StringSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/UserSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/UserSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Event.d.ts +0 -0
- /package/dist/{types → src/types}/Event.js +0 -0
- /package/dist/{types → src/types}/Interaction.d.ts +0 -0
- /package/dist/{types → src/types}/Interaction.js +0 -0
- /package/dist/{types → src/types}/other/CustomEvent.d.ts +0 -0
- /package/dist/{types → src/types}/other/CustomEvent.js +0 -0
- /package/dist/{types → src/types}/other/FakeMessageInteraction.d.ts +0 -0
- /package/dist/{types → src/types}/other/FakeMessageInteraction.js +0 -0
- /package/dist/{types → src/types}/other/InteractionLocale.d.ts +0 -0
- /package/dist/{types → src/types}/other/InteractionLocale.js +0 -0
- /package/dist/{types → src/types}/other/Locale.d.ts +0 -0
- /package/dist/{types → src/types}/other/Locale.js +0 -0
- /package/dist/{types → src/types}/other/MessageContextMenu.d.ts +0 -0
- /package/dist/{types → src/types}/other/MessageContextMenu.js +0 -0
- /package/dist/{types → src/types}/other/UserContextMenu.d.ts +0 -0
- /package/dist/{types → src/types}/other/UserContextMenu.js +0 -0
- /package/dist/{utils → src/utils}/MemoryStore.d.ts +0 -0
- /package/dist/{utils → src/utils}/MemoryStore.js +0 -0
- /package/dist/{utils → src/utils}/UtilTypes.d.ts +0 -0
- /package/dist/{utils → src/utils}/UtilTypes.js +0 -0
- /package/dist/{utils → src/utils}/customId.d.ts +0 -0
- /package/dist/{utils → src/utils}/customId.js +0 -0
- /package/dist/{utils → src/utils}/permissions.d.ts +0 -0
- /package/dist/{utils → src/utils}/permissions.js +0 -0
- /package/dist/{utils → src/utils}/recursiveImport.d.ts +0 -0
- /package/dist/{utils → src/utils}/recursiveImport.js +0 -0
- /package/dist/{utils → src/utils}/recursiveUnload.d.ts +0 -0
- /package/dist/{utils → src/utils}/recursiveUnload.js +0 -0
- /package/dist/{utils → src/utils}/unloadModule.d.ts +0 -0
- /package/dist/{utils → src/utils}/unloadModule.js +0 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { compile } from "svelte/compiler";
|
|
2
|
+
import { DBI } from "../../../DBI";
|
|
3
|
+
import { NamespaceEnums } from "../../../../generated/namespaceData";
|
|
4
|
+
import { parseHTMLComponentsV2 } from "./parser";
|
|
5
|
+
import { parseSvelteComponent, createHandlerContext, SvelteComponentInfo, HandlerContextResult } from "./svelteParser";
|
|
6
|
+
import * as stuffs from "stuffs";
|
|
7
|
+
|
|
8
|
+
export interface SvelteRenderOptions {
|
|
9
|
+
data?: Record<string, any>;
|
|
10
|
+
ttl?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SvelteRenderResult {
|
|
14
|
+
components: any[];
|
|
15
|
+
handlers: Map<string, { handlerFn: Function, context: any }>;
|
|
16
|
+
componentInfo: SvelteComponentInfo;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Compile and render a Svelte component to Discord components
|
|
21
|
+
*/
|
|
22
|
+
export function renderSvelteComponent(
|
|
23
|
+
dbi: DBI<NamespaceEnums>,
|
|
24
|
+
source: string,
|
|
25
|
+
dbiName: string,
|
|
26
|
+
options: SvelteRenderOptions = {}
|
|
27
|
+
): SvelteRenderResult {
|
|
28
|
+
const { data = {}, ttl = 0 } = options;
|
|
29
|
+
|
|
30
|
+
// Parse the Svelte component to extract handlers
|
|
31
|
+
// This also injects auto-generated names into elements without name attribute
|
|
32
|
+
const componentInfo = parseSvelteComponent(source, data);
|
|
33
|
+
|
|
34
|
+
// Use the processed source (with auto-generated names injected)
|
|
35
|
+
const processedSource = componentInfo.processedSource;
|
|
36
|
+
|
|
37
|
+
// Compile the Svelte component for SSR
|
|
38
|
+
const compiled = compile(processedSource, {
|
|
39
|
+
generate: "server",
|
|
40
|
+
css: "injected",
|
|
41
|
+
dev: false,
|
|
42
|
+
} as any);
|
|
43
|
+
|
|
44
|
+
// Create a module context for the compiled code
|
|
45
|
+
let html = "";
|
|
46
|
+
try {
|
|
47
|
+
const moduleContext = createModuleContext(dbi, data, ttl);
|
|
48
|
+
const componentModule = evaluateCompiledComponent(compiled.js.code, moduleContext);
|
|
49
|
+
|
|
50
|
+
// Render the component with props (include data in props)
|
|
51
|
+
const renderResult = componentModule.render({ ...data, data });
|
|
52
|
+
html = renderResult.html || renderResult.body || "";
|
|
53
|
+
|
|
54
|
+
// Debug: Log rendered HTML
|
|
55
|
+
if (process.env.DEBUG_SVELTE) {
|
|
56
|
+
console.log("Rendered HTML:", html);
|
|
57
|
+
}
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error("Error rendering Svelte component:", error);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.log("Rendered HTML:", html);
|
|
64
|
+
|
|
65
|
+
// For Svelte mode, inject state into interactive elements as a ref
|
|
66
|
+
// Reuse existing ref if data already has one, otherwise create new
|
|
67
|
+
if (data && Object.keys(data).length > 0) {
|
|
68
|
+
let stateRefId: string;
|
|
69
|
+
|
|
70
|
+
// Check if data already has a $ref (from previous render)
|
|
71
|
+
if (data.$ref && typeof data.$ref === 'string') {
|
|
72
|
+
stateRefId = data.$ref;
|
|
73
|
+
// Update the existing ref's value with new data
|
|
74
|
+
const existingRef = dbi.data.refs.get(stateRefId);
|
|
75
|
+
if (existingRef) {
|
|
76
|
+
existingRef.value = data;
|
|
77
|
+
existingRef.at = Date.now(); // Refresh timestamp
|
|
78
|
+
} else {
|
|
79
|
+
// Ref expired or was deleted, create new one with same ID
|
|
80
|
+
dbi.data.refs.set(stateRefId, { at: Date.now(), value: data, ttl });
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
// Create a new ref for the state
|
|
84
|
+
stateRefId = stuffs.randomString(8);
|
|
85
|
+
data.$ref = stateRefId; // Store ref ID in data for future updates
|
|
86
|
+
dbi.data.refs.set(stateRefId, { at: Date.now(), value: data, ttl });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Add state ref to all elements with name attribute (buttons, selects)
|
|
90
|
+
html = html.replace(/<button([^>]*name="[^"]*"[^>]*)>/g, (match, attrs) => {
|
|
91
|
+
// Check if it already has data attributes
|
|
92
|
+
if (attrs.includes('data-1:')) return match;
|
|
93
|
+
return `<button${attrs} data-1:ref="${stateRefId}">`;
|
|
94
|
+
});
|
|
95
|
+
// Also handle select elements
|
|
96
|
+
html = html.replace(/<(string-select|user-select|role-select|channel-select|mentionable-select)([^>]*name="[^"]*"[^>]*)>/g, (match, tag, attrs) => {
|
|
97
|
+
if (attrs.includes('data-1:')) return match;
|
|
98
|
+
return `<${tag}${attrs} data-1:ref="${stateRefId}">`;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
console.log("HTML with state:", html);
|
|
103
|
+
|
|
104
|
+
// Parse the rendered HTML to Discord components
|
|
105
|
+
const components = parseHTMLComponentsV2(dbi, html, dbiName, { data, ttl });
|
|
106
|
+
|
|
107
|
+
console.log("Parsed Components:", JSON.stringify(components, null, 2));
|
|
108
|
+
|
|
109
|
+
// Create handler context (also captures $effect callbacks)
|
|
110
|
+
const handlerContext = createHandlerContext(componentInfo.scriptContent, data);
|
|
111
|
+
const handlers = new Map<string, { handlerFn: Function, context: any }>();
|
|
112
|
+
|
|
113
|
+
// Run effects on initial render
|
|
114
|
+
handlerContext.runEffects();
|
|
115
|
+
|
|
116
|
+
// Map handlers to component names
|
|
117
|
+
componentInfo.handlers.forEach((handlerInfo, componentName) => {
|
|
118
|
+
const handlerFn = handlerContext.handlers[handlerInfo.handlerName];
|
|
119
|
+
if (handlerFn && typeof handlerFn === "function") {
|
|
120
|
+
handlers.set(componentName, {
|
|
121
|
+
handlerFn,
|
|
122
|
+
context: data
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
components,
|
|
129
|
+
handlers,
|
|
130
|
+
componentInfo
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Create a module context for evaluating the compiled Svelte component
|
|
136
|
+
*/
|
|
137
|
+
function createModuleContext(dbi: DBI<NamespaceEnums>, data: Record<string, any>, ttl: number) {
|
|
138
|
+
return {
|
|
139
|
+
// Store objects in refs for later retrieval in handlers
|
|
140
|
+
// This is used internally by the parser when converting to Discord components
|
|
141
|
+
__storeRef: (obj: any) => {
|
|
142
|
+
let id = stuffs.randomString(8);
|
|
143
|
+
dbi.data.refs.set(id, { at: Date.now(), value: obj, ttl });
|
|
144
|
+
return id;
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
// DBI instance for advanced usage
|
|
148
|
+
__dbi: dbi,
|
|
149
|
+
|
|
150
|
+
// All data context available
|
|
151
|
+
...data,
|
|
152
|
+
data, // Also expose as 'data' prop
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Evaluate the compiled Svelte component code
|
|
158
|
+
*/
|
|
159
|
+
function evaluateCompiledComponent(code: string, context: Record<string, any>): any {
|
|
160
|
+
try {
|
|
161
|
+
// Aggressively strip ALL import statements
|
|
162
|
+
// Svelte 5 generates imports with special chars like $ that need careful handling
|
|
163
|
+
let processedCode = code;
|
|
164
|
+
|
|
165
|
+
// Remove all lines that start with 'import' (most reliable approach)
|
|
166
|
+
processedCode = processedCode
|
|
167
|
+
.split('\n')
|
|
168
|
+
.filter(line => !line.trim().startsWith('import '))
|
|
169
|
+
.join('\n');
|
|
170
|
+
|
|
171
|
+
// Also remove 'export default' and replace with assignment
|
|
172
|
+
processedCode = processedCode.replace(/export\s+default\s+/g, 'module.exports = ');
|
|
173
|
+
|
|
174
|
+
// Create exports object
|
|
175
|
+
const exports: any = {};
|
|
176
|
+
const module = { exports };
|
|
177
|
+
|
|
178
|
+
// Provide Svelte 5 server runtime functions
|
|
179
|
+
// The compiled code references these via the $ namespace
|
|
180
|
+
const $: any = {
|
|
181
|
+
// Escape functions
|
|
182
|
+
escape: (str: any) => String(str)
|
|
183
|
+
.replace(/&/g, "&")
|
|
184
|
+
.replace(/</g, "<")
|
|
185
|
+
.replace(/>/g, ">")
|
|
186
|
+
.replace(/"/g, """)
|
|
187
|
+
.replace(/'/g, "'"),
|
|
188
|
+
escape_text: (str: any) => String(str)
|
|
189
|
+
.replace(/&/g, "&")
|
|
190
|
+
.replace(/</g, "<")
|
|
191
|
+
.replace(/>/g, ">"),
|
|
192
|
+
escape_attribute_value: (str: any) => String(str)
|
|
193
|
+
.replace(/"/g, """)
|
|
194
|
+
.replace(/'/g, "'"),
|
|
195
|
+
// Array helpers for {#each}
|
|
196
|
+
ensure_array_like: (value: any) => {
|
|
197
|
+
if (Array.isArray(value)) return value;
|
|
198
|
+
if (value == null) return [];
|
|
199
|
+
if (typeof value === 'object' && Symbol.iterator in value) {
|
|
200
|
+
return Array.from(value);
|
|
201
|
+
}
|
|
202
|
+
return [value];
|
|
203
|
+
},
|
|
204
|
+
// Renderer methods
|
|
205
|
+
component: (fn: Function) => fn,
|
|
206
|
+
push: (content: string) => content,
|
|
207
|
+
pop: () => { },
|
|
208
|
+
attr: (name: string, value: any, is_boolean?: boolean) => {
|
|
209
|
+
if (is_boolean && !value) return '';
|
|
210
|
+
if (value == null) return '';
|
|
211
|
+
return ` ${name}="${String(value)}"`;
|
|
212
|
+
},
|
|
213
|
+
spread_attributes: (attrs: Record<string, any>) => {
|
|
214
|
+
return Object.entries(attrs)
|
|
215
|
+
.map(([key, value]) => ` ${key}="${String(value)}"`)
|
|
216
|
+
.join('');
|
|
217
|
+
},
|
|
218
|
+
spread_props: (props: Record<string, any>) => props,
|
|
219
|
+
bind_props: (props: Record<string, any>, names: string[]) => {
|
|
220
|
+
const result: any = {};
|
|
221
|
+
names.forEach(name => {
|
|
222
|
+
if (name in props) result[name] = props[name];
|
|
223
|
+
});
|
|
224
|
+
return result;
|
|
225
|
+
},
|
|
226
|
+
stringify: (value: any) => JSON.stringify(value),
|
|
227
|
+
store_get: (store: any) => store,
|
|
228
|
+
unsubscribe_stores: () => { },
|
|
229
|
+
// Control flow
|
|
230
|
+
each: (items: any[], fn: Function) => {
|
|
231
|
+
return items.map((item, index) => fn(item, index)).join('');
|
|
232
|
+
},
|
|
233
|
+
// Lifecycle
|
|
234
|
+
tick: () => Promise.resolve(),
|
|
235
|
+
flush: () => { },
|
|
236
|
+
// Validation
|
|
237
|
+
validate_component: (component: any) => component,
|
|
238
|
+
validate_store: (store: any) => store,
|
|
239
|
+
// Misc
|
|
240
|
+
noop: () => { },
|
|
241
|
+
run: (fn: Function) => fn(),
|
|
242
|
+
run_all: (fns: Function[]) => fns.forEach(f => f()),
|
|
243
|
+
is_promise: (value: any) => value && typeof value.then === 'function',
|
|
244
|
+
missing_component: { $$render: () => '' },
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// Create renderer object that accumulates HTML
|
|
248
|
+
let html = '';
|
|
249
|
+
const $$renderer: any = {
|
|
250
|
+
out: '',
|
|
251
|
+
head: '',
|
|
252
|
+
component: (fn: Function) => {
|
|
253
|
+
return fn($$renderer);
|
|
254
|
+
},
|
|
255
|
+
push: (content: string) => {
|
|
256
|
+
html += content;
|
|
257
|
+
return $$renderer;
|
|
258
|
+
},
|
|
259
|
+
pop: () => $$renderer,
|
|
260
|
+
element: (tag: string, fn: Function) => {
|
|
261
|
+
html += `<${tag}`;
|
|
262
|
+
fn();
|
|
263
|
+
html += `>`;
|
|
264
|
+
return $$renderer;
|
|
265
|
+
},
|
|
266
|
+
close: (tag: string) => {
|
|
267
|
+
html += `</${tag}>`;
|
|
268
|
+
return $$renderer;
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// Create a function wrapper with all context and Svelte runtime
|
|
273
|
+
// Include lifecycle stubs - these are no-ops in SSR but need to be defined
|
|
274
|
+
const allContext = {
|
|
275
|
+
...context,
|
|
276
|
+
$,
|
|
277
|
+
$$renderer,
|
|
278
|
+
module,
|
|
279
|
+
exports,
|
|
280
|
+
// Lifecycle stubs for SSR (actual lifecycle runs in handler context)
|
|
281
|
+
onMount: (fn: Function) => { /* SSR no-op, real onMount runs in handler context */ },
|
|
282
|
+
onDestroy: (fn: Function) => { /* SSR no-op, real onDestroy runs in handler context */ },
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const contextKeys = Object.keys(allContext);
|
|
286
|
+
const contextValues = Object.values(allContext);
|
|
287
|
+
|
|
288
|
+
// Wrap in IIFE
|
|
289
|
+
const wrappedCode = `
|
|
290
|
+
(function(${contextKeys.join(", ")}) {
|
|
291
|
+
${processedCode}
|
|
292
|
+
return module.exports;
|
|
293
|
+
})
|
|
294
|
+
`;
|
|
295
|
+
|
|
296
|
+
// Evaluate the code
|
|
297
|
+
const func = eval(wrappedCode);
|
|
298
|
+
const component = func(...contextValues);
|
|
299
|
+
|
|
300
|
+
// Return a render function
|
|
301
|
+
return {
|
|
302
|
+
render: (props: any) => {
|
|
303
|
+
html = '';
|
|
304
|
+
try {
|
|
305
|
+
component($$renderer, props);
|
|
306
|
+
return { html, head: '', css: { code: '', map: null } };
|
|
307
|
+
} catch (e) {
|
|
308
|
+
console.error('Component render error:', e);
|
|
309
|
+
throw e;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
} catch (error) {
|
|
314
|
+
console.error("Error evaluating compiled component:", error);
|
|
315
|
+
console.error("Code preview (first 500 chars):", code.substring(0, 500));
|
|
316
|
+
throw error;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Render a Svelte component from a file
|
|
322
|
+
*/
|
|
323
|
+
export function renderSvelteComponentFromFile(
|
|
324
|
+
dbi: DBI<NamespaceEnums>,
|
|
325
|
+
filePath: string,
|
|
326
|
+
dbiName: string,
|
|
327
|
+
options: SvelteRenderOptions = {}
|
|
328
|
+
): SvelteRenderResult {
|
|
329
|
+
const fs = require("fs");
|
|
330
|
+
const source = fs.readFileSync(filePath, "utf-8");
|
|
331
|
+
return renderSvelteComponent(dbi, source, dbiName, options);
|
|
332
|
+
}
|
package/test/index.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createDBI } from "../src";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
const dbi = createDBI("svelte", {
|
|
5
|
+
discord: {
|
|
6
|
+
token: "YOUR_BOT_TOKEN_HERE",
|
|
7
|
+
options: {
|
|
8
|
+
intents: [
|
|
9
|
+
"GuildMessages",
|
|
10
|
+
"Guilds",
|
|
11
|
+
"MessageContent",
|
|
12
|
+
"GuildMessageReactions"
|
|
13
|
+
],
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
references: {
|
|
17
|
+
autoClear: {
|
|
18
|
+
ttl: 60000 * 60, // 60 minutes
|
|
19
|
+
check: 60000 // every 60 seconds
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
dbi.register(({ ChatInput, HTMLComponentsV2 }) => {
|
|
25
|
+
// Svelte product showcase with Components V2
|
|
26
|
+
HTMLComponentsV2({
|
|
27
|
+
name: "product-showcase",
|
|
28
|
+
mode: 'svelte',
|
|
29
|
+
file: path.join(__dirname, "product-showcase.svelte"),
|
|
30
|
+
onExecute(ctx) {
|
|
31
|
+
console.log("Product showcase interaction:", ctx.data[0]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Test command
|
|
36
|
+
ChatInput({
|
|
37
|
+
name: "test-svelte",
|
|
38
|
+
description: "Test Svelte product showcase",
|
|
39
|
+
async onExecute({ interaction, dbi }) {
|
|
40
|
+
const showcase = dbi.interaction("product-showcase") as any;
|
|
41
|
+
|
|
42
|
+
const products = [
|
|
43
|
+
{
|
|
44
|
+
name: "Gaming Keyboard",
|
|
45
|
+
description: "RGB mechanical keyboard with Cherry MX switches",
|
|
46
|
+
price: 149,
|
|
47
|
+
image: "https://cdn.discordapp.com/embed/avatars/0.png",
|
|
48
|
+
category: "Electronics",
|
|
49
|
+
rating: 4.8,
|
|
50
|
+
stock: 25
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "Wireless Mouse",
|
|
54
|
+
description: "Ergonomic wireless mouse with 16000 DPI sensor",
|
|
55
|
+
price: 79,
|
|
56
|
+
image: "https://cdn.discordapp.com/embed/avatars/1.png",
|
|
57
|
+
category: "Electronics",
|
|
58
|
+
rating: 4.5,
|
|
59
|
+
stock: 42
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "USB-C Hub",
|
|
63
|
+
description: "7-in-1 USB-C hub with HDMI, USB 3.0, and SD card reader",
|
|
64
|
+
price: 59,
|
|
65
|
+
image: "https://cdn.discordapp.com/embed/avatars/2.png",
|
|
66
|
+
category: "Accessories",
|
|
67
|
+
rating: 4.3,
|
|
68
|
+
stock: 18
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Monitor Stand",
|
|
72
|
+
description: "Adjustable monitor stand with cable management",
|
|
73
|
+
price: 89,
|
|
74
|
+
image: "https://cdn.discordapp.com/embed/avatars/3.png",
|
|
75
|
+
category: "Furniture",
|
|
76
|
+
rating: 4.6,
|
|
77
|
+
stock: 31
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
// Use send() method - this sends the message AND initializes lifecycle hooks (onMount)
|
|
82
|
+
// The interval in onMount will start immediately after the message is sent
|
|
83
|
+
await showcase.send(interaction, {
|
|
84
|
+
data: {
|
|
85
|
+
products,
|
|
86
|
+
currentIndex: 0,
|
|
87
|
+
cart: [],
|
|
88
|
+
view: 'browse',
|
|
89
|
+
elapsedTime: 0
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
console.log("Loading DBI...");
|
|
98
|
+
dbi.load().then(() => {
|
|
99
|
+
dbi.publish("Guild", "1341841733511806978")
|
|
100
|
+
console.log("DBI loaded.");
|
|
101
|
+
dbi.login().then(() => {
|
|
102
|
+
console.log("Bot is running with Svelte components!");
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}, 100);
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/// <reference types="@mostfeatured/dbi/svelte" />
|
|
3
|
+
import stuffs from "stuffs";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
products = [],
|
|
7
|
+
currentIndex = 0,
|
|
8
|
+
cart = [],
|
|
9
|
+
view = "browse", // 'browse' | 'cart' | 'details'
|
|
10
|
+
elapsedTime = 0,
|
|
11
|
+
} = $props();
|
|
12
|
+
|
|
13
|
+
// Format elapsed time using stuffs
|
|
14
|
+
function formatTime(seconds) {
|
|
15
|
+
return stuffs.formatSeconds(seconds);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function nextProduct() {
|
|
19
|
+
data.currentIndex = (currentIndex + 1) % products.length;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function prevProduct() {
|
|
23
|
+
data.currentIndex = (currentIndex - 1 + products.length) % products.length;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function addToCart(ctx) {
|
|
27
|
+
const product = products[currentIndex];
|
|
28
|
+
data.cart = [...cart, product];
|
|
29
|
+
ctx.interaction.reply({
|
|
30
|
+
content:
|
|
31
|
+
"✅ Added **" +
|
|
32
|
+
product.name +
|
|
33
|
+
"** to cart! (Cart: " +
|
|
34
|
+
data.cart.length +
|
|
35
|
+
" items)",
|
|
36
|
+
flags: ["Ephemeral"],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function showCart() {
|
|
41
|
+
data.view = "cart";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function showBrowse() {
|
|
45
|
+
data.view = "browse";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function showDetails() {
|
|
49
|
+
data.view = "details";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function clearCart(ctx) {
|
|
53
|
+
data.cart = [];
|
|
54
|
+
ctx.interaction.reply({
|
|
55
|
+
content: "🗑️ Cart cleared!",
|
|
56
|
+
flags: ["Ephemeral"],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function checkout(ctx) {
|
|
61
|
+
if (cart.length === 0) {
|
|
62
|
+
ctx.interaction.reply({
|
|
63
|
+
content: "Cart is empty!",
|
|
64
|
+
flags: ["Ephemeral"],
|
|
65
|
+
});
|
|
66
|
+
noRender(); // Cart boşsa UI güncellemeye gerek yok
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const total = cart.reduce((sum, p) => sum + p.price, 0);
|
|
70
|
+
ctx.interaction.reply({
|
|
71
|
+
content:
|
|
72
|
+
"💳 **Order Placed!**\\nItems: " + cart.length + "\\nTotal: $" + total,
|
|
73
|
+
flags: ["Ephemeral"],
|
|
74
|
+
});
|
|
75
|
+
data.cart = [];
|
|
76
|
+
data.view = "browse";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onMount(() => {
|
|
80
|
+
data.elapsedTime = 0;
|
|
81
|
+
const interval = setInterval(() => {
|
|
82
|
+
data.elapsedTime += 1;
|
|
83
|
+
}, 1000);
|
|
84
|
+
|
|
85
|
+
return () => {
|
|
86
|
+
clearInterval(interval);
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<components>
|
|
92
|
+
{#if view === "browse"}
|
|
93
|
+
<container accent-color="5865F2">
|
|
94
|
+
<components>
|
|
95
|
+
<section>
|
|
96
|
+
<components>
|
|
97
|
+
<text-display>## 🛍️ Product Showcase</text-display>
|
|
98
|
+
<text-display
|
|
99
|
+
>**{products[currentIndex]?.name}**
|
|
100
|
+
{products[currentIndex]?.description}</text-display
|
|
101
|
+
>
|
|
102
|
+
<text-display>💰 **\${products[currentIndex]?.price}**</text-display
|
|
103
|
+
>
|
|
104
|
+
</components>
|
|
105
|
+
<thumbnail media={products[currentIndex]?.image}></thumbnail>
|
|
106
|
+
</section>
|
|
107
|
+
|
|
108
|
+
<separator></separator>
|
|
109
|
+
|
|
110
|
+
<text-display
|
|
111
|
+
>📦 Product {currentIndex + 1} of {products.length} | 🛒 Cart: {cart.length}
|
|
112
|
+
items</text-display
|
|
113
|
+
>
|
|
114
|
+
|
|
115
|
+
<action-row>
|
|
116
|
+
<button style="Secondary" onclick={prevProduct}>◀️ Prev</button>
|
|
117
|
+
<button style="Secondary" onclick={nextProduct}>Next ▶️</button>
|
|
118
|
+
<button style="Success" onclick={addToCart}>🛒 Add to Cart</button>
|
|
119
|
+
<button style="Primary" onclick={showDetails}>📋 Details</button>
|
|
120
|
+
<button style="Primary" onclick={showCart}
|
|
121
|
+
>🛒 View Cart ({cart.length})</button
|
|
122
|
+
>
|
|
123
|
+
</action-row>
|
|
124
|
+
|
|
125
|
+
<separator></separator>
|
|
126
|
+
<text-display>⏱️ Session: {formatTime(elapsedTime)}</text-display>
|
|
127
|
+
</components>
|
|
128
|
+
</container>
|
|
129
|
+
{:else if view === "cart"}
|
|
130
|
+
<container accent-color="57F287">
|
|
131
|
+
<components>
|
|
132
|
+
<text-display>## 🛒 Your Cart</text-display>
|
|
133
|
+
|
|
134
|
+
{#if cart.length === 0}
|
|
135
|
+
<text-display>*Your cart is empty*</text-display>
|
|
136
|
+
{:else}
|
|
137
|
+
{#each cart as item, i}
|
|
138
|
+
<text-display>• **{item.name}** - \${item.price}</text-display>
|
|
139
|
+
{/each}
|
|
140
|
+
<separator></separator>
|
|
141
|
+
<text-display
|
|
142
|
+
>**Total: \${cart.reduce(
|
|
143
|
+
(sum, p) => sum + p.price,
|
|
144
|
+
0
|
|
145
|
+
)}**</text-display
|
|
146
|
+
>
|
|
147
|
+
{/if}
|
|
148
|
+
|
|
149
|
+
<action-row>
|
|
150
|
+
<button style="Secondary" onclick={showBrowse}
|
|
151
|
+
>◀️ Back to Browse</button
|
|
152
|
+
>
|
|
153
|
+
<button style="Danger" onclick={clearCart}>🗑️ Clear Cart</button>
|
|
154
|
+
<button style="Success" onclick={checkout}>💳 Checkout</button>
|
|
155
|
+
</action-row>
|
|
156
|
+
|
|
157
|
+
<separator></separator>
|
|
158
|
+
<text-display>⏱️ Session: {formatTime(elapsedTime)}</text-display>
|
|
159
|
+
</components>
|
|
160
|
+
</container>
|
|
161
|
+
{:else if view === "details"}
|
|
162
|
+
<container accent-color="FEE75C">
|
|
163
|
+
<components>
|
|
164
|
+
<section>
|
|
165
|
+
<components>
|
|
166
|
+
<text-display>## 📋 Product Details</text-display>
|
|
167
|
+
<text-display>**{products[currentIndex]?.name}**</text-display>
|
|
168
|
+
</components>
|
|
169
|
+
<thumbnail media={products[currentIndex]?.image}></thumbnail>
|
|
170
|
+
</section>
|
|
171
|
+
|
|
172
|
+
<separator></separator>
|
|
173
|
+
|
|
174
|
+
<text-display
|
|
175
|
+
>### Description
|
|
176
|
+
{products[currentIndex]?.description}</text-display
|
|
177
|
+
>
|
|
178
|
+
|
|
179
|
+
<separator></separator>
|
|
180
|
+
|
|
181
|
+
<text-display
|
|
182
|
+
>### Specifications • **Category:** {products[currentIndex]?.category}
|
|
183
|
+
• **Rating:** ⭐ {products[currentIndex]?.rating}/5 • **Stock:** {products[
|
|
184
|
+
currentIndex
|
|
185
|
+
]?.stock} available • **Price:** 💰 **\${products[currentIndex]
|
|
186
|
+
?.price}**</text-display
|
|
187
|
+
>
|
|
188
|
+
|
|
189
|
+
<action-row>
|
|
190
|
+
<button style="Secondary" onclick={showBrowse}>◀️ Back</button>
|
|
191
|
+
<button style="Success" onclick={addToCart}>🛒 Add to Cart</button>
|
|
192
|
+
</action-row>
|
|
193
|
+
|
|
194
|
+
<separator></separator>
|
|
195
|
+
<text-display>⏱️ Session: {formatTime(elapsedTime)}</text-display>
|
|
196
|
+
</components>
|
|
197
|
+
</container>
|
|
198
|
+
{/if}
|
|
199
|
+
</components>
|
package/tsconfig.json
CHANGED
|
@@ -33,9 +33,19 @@
|
|
|
33
33
|
"lib": [
|
|
34
34
|
"ESNext"
|
|
35
35
|
],
|
|
36
|
-
"target": "ESNext",
|
|
36
|
+
"target": "ESNext",
|
|
37
37
|
"useDefineForClassFields": true,
|
|
38
38
|
"skipLibCheck": true,
|
|
39
|
-
"skipDefaultLibCheck": true
|
|
40
|
-
|
|
39
|
+
"skipDefaultLibCheck": true,
|
|
40
|
+
// Include DBI Svelte type definitions
|
|
41
|
+
"typeRoots": [
|
|
42
|
+
"./node_modules/@types",
|
|
43
|
+
"./generated"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"include": [
|
|
47
|
+
"src/**/*",
|
|
48
|
+
"test/**/*",
|
|
49
|
+
"generated/**/*"
|
|
50
|
+
]
|
|
41
51
|
}
|
package/dist/DBI.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DBI.d.ts","sourceRoot":"","sources":["../src/DBI.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,qCAAqC,CA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