🎨 Fix CSS: Import global.css + plain CSS styles

CSS was not being imported! Fixed:

 Added 'import ../styles/global.css' to BaseLayout.astro
 Rewrote CSS with plain CSS (not @apply which wasn't working)
 Cookie banner has inline styles as backup
 Font size: 16px base
 Solid colors: green-600 (#16a34a), gray-900 (#111827)
 Footer has policy links

Build: 12 pages 
This commit is contained in:
Kunthawat Greethong
2026-03-10 08:21:30 +07:00
parent 0d3c8fa5b8
commit 3ed9f3f3ff
11122 changed files with 1624110 additions and 180 deletions

BIN
.astro/content.db Normal file

Binary file not shown.

BIN
.astro/data.db Normal file

Binary file not shown.

7
.astro/integrations/astro_db/db.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
// This file is generated by Astro DB
declare module 'astro:db' {
export const ConsentLog: import("@astrojs/db/runtime").Table<
"ConsentLog",
{"id":{"type":"number","schema":{"unique":false,"deprecated":false,"name":"id","collection":"ConsentLog","primaryKey":true}},"sessionId":{"type":"text","schema":{"unique":true,"deprecated":false,"name":"sessionId","collection":"ConsentLog","primaryKey":false,"optional":false}},"timestamp":{"type":"date","schema":{"optional":false,"unique":false,"deprecated":false,"name":"timestamp","collection":"ConsentLog","default":{"__serializedSQL":true,"sql":"CURRENT_TIMESTAMP"}}},"locale":{"type":"text","schema":{"unique":false,"deprecated":false,"name":"locale","collection":"ConsentLog","default":"th","primaryKey":false,"optional":false}},"essential":{"type":"boolean","schema":{"optional":false,"unique":false,"deprecated":false,"name":"essential","collection":"ConsentLog","default":true}},"analytics":{"type":"boolean","schema":{"optional":false,"unique":false,"deprecated":false,"name":"analytics","collection":"ConsentLog","default":false}},"marketing":{"type":"boolean","schema":{"optional":false,"unique":false,"deprecated":false,"name":"marketing","collection":"ConsentLog","default":false}},"policyVersion":{"type":"text","schema":{"unique":false,"deprecated":false,"name":"policyVersion","collection":"ConsentLog","default":"1.0","primaryKey":false,"optional":false}},"ipHash":{"type":"text","schema":{"unique":false,"deprecated":false,"name":"ipHash","collection":"ConsentLog","primaryKey":false,"optional":false}},"userAgent":{"type":"text","schema":{"unique":false,"deprecated":false,"name":"userAgent","collection":"ConsentLog","primaryKey":false,"optional":false}}}
>;
}

1
.astro/types.d.ts vendored
View File

@@ -1,2 +1,3 @@
/// <reference types="astro/client" /> /// <reference types="astro/client" />
/// <reference path="integrations/astro_db/db.d.ts" />
/// <reference path="content.d.ts" /> /// <reference path="content.d.ts" />

View File

@@ -1,5 +1,11 @@
# Environment Configuration for Deal Plus Tech Website # Environment Configuration for Deal Plus Tech Website
# Copy this file to .env.local and fill in the values # Copy this file to .env and fill in the values
# Admin Configuration
ADMIN_PASSWORD=dealplustech
# Astro DB (for consent logging)
ASTRO_DB_REMOTE_URL=file:./data/consent.db
# Site Configuration # Site Configuration
NEXT_PUBLIC_SITE_URL=https://dealplustech.co.th NEXT_PUBLIC_SITE_URL=https://dealplustech.co.th
@@ -13,30 +19,8 @@ NEXT_PUBLIC_FACEBOOK_URL=https://facebook.com/dealplustech
# Company Information # Company Information
NEXT_PUBLIC_COMPANY_ADDRESS=บริษัท ดีล พลัส เทค จำกัด 9/70 ซอยนครลุง 17 แขวงบางไผ่ เขตบางแค กทม. 10160 NEXT_PUBLIC_COMPANY_ADDRESS=บริษัท ดีล พลัส เทค จำกัด 9/70 ซอยนครลุง 17 แขวงบางไผ่ เขตบางแค กทม. 10160
# Google Analytics 4 (Required for tracking) # Google Analytics 4 (Required for tracking - requires user consent)
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
# Google Search Console Verification (optional)
# NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=your-verification-code
# WordPress API (optional - for blog integration) # WordPress API (optional - for blog integration)
# NEXT_PUBLIC_WORDPRESS_API_URL=https://your-wordpress-site.com/wp-json/wp/v2 # NEXT_PUBLIC_WORDPRESS_API_URL=https://your-wordpress-site.com/wp-json/wp/v2
# Copy this file to .env.local and fill in the values
# Site Configuration
NEXT_PUBLIC_SITE_URL=https://dealplustech.co.th
# Contact Information
NEXT_PUBLIC_PHONE=090-555-1415
NEXT_PUBLIC_EMAIL=dealplustech@gmail.com
NEXT_PUBLIC_LINE_ID=jppselection
NEXT_PUBLIC_FACEBOOK_URL=https://www.facebook.com/Dealplustech/
# Company Information
NEXT_PUBLIC_COMPANY_ADDRESS=9/70 ซอยนครลุง 17 แขวงบางไผ่ เขตบางแค กทม. 10160
# Google Analytics (optional)
# NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
# Google Search Console Verification (optional)
# NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=your-verification-code

View File

@@ -1,15 +1,14 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import db from '@astrojs/db';
import tailwindcss from '@tailwindcss/vite'; import tailwindcss from '@tailwindcss/vite';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [db({})],
vite: { vite: {
plugins: [tailwindcss()], plugins: [tailwindcss()],
}, },
// Ensure public folder is copied to dist
publicDir: './public', publicDir: './public',
// Build output
output: 'static', output: 'static',
// Base path (if needed)
base: '/', base: '/',
}); });

22
db/config.ts Normal file
View File

@@ -0,0 +1,22 @@
import { defineTable, column, NOW } from 'astro:db';
const ConsentLog = defineTable({
columns: {
id: column.number({ primaryKey: true, autoIncrement: true }),
sessionId: column.text({ unique: true }),
timestamp: column.date({ default: NOW }),
locale: column.text({ default: 'th' }),
essential: column.boolean({ default: true }),
analytics: column.boolean({ default: false }),
marketing: column.boolean({ default: false }),
policyVersion: column.text({ default: '1.0' }),
ipHash: column.text(),
userAgent: column.text(),
},
});
export default {
tables: {
ConsentLog,
},
};

View File

@@ -0,0 +1,288 @@
declare module 'astro:content' {
interface RenderResult {
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}
interface Render {
'.md': Promise<RenderResult>;
}
export interface RenderedContent {
html: string;
metadata?: {
imagePaths: Array<string>;
[key: string]: unknown;
};
}
}
declare module 'astro:content' {
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
export type ContentCollectionKey = keyof ContentEntryMap;
export type DataCollectionKey = keyof DataEntryMap;
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
ContentEntryMap[C]
>['slug'];
/** @deprecated Use `getEntry` instead. */
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
/** @deprecated Use `getEntry` instead. */
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E,
): Promise<CollectionEntry<C>>;
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E,
): Promise<E[]>;
export function getCollection<C extends keyof AnyEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown,
): Promise<CollectionEntry<C>[]>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
}): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
}): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E,
): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
/** Resolve an array of entry references from the same collection */
export function getEntries<C extends keyof ContentEntryMap>(
entries: {
collection: C;
slug: ValidContentEntrySlug<C>;
}[],
): Promise<CollectionEntry<C>[]>;
export function getEntries<C extends keyof DataEntryMap>(
entries: {
collection: C;
id: keyof DataEntryMap[C];
}[],
): Promise<CollectionEntry<C>[]>;
export function render<C extends keyof AnyEntryMap>(
entry: AnyEntryMap[C][string],
): Promise<RenderResult>;
export function reference<C extends keyof AnyEntryMap>(
collection: C,
): import('astro/zod').ZodEffects<
import('astro/zod').ZodString,
C extends keyof ContentEntryMap
? {
collection: C;
slug: ValidContentEntrySlug<C>;
}
: {
collection: C;
id: keyof DataEntryMap[C];
}
>;
// Allow generic `string` to avoid excessive type errors in the config
// if `dev` is not running to update as you edit.
// Invalid collection names will be caught at build time.
export function reference<C extends string>(
collection: C,
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
>;
type ContentEntryMap = {
"products": {
"anchors.md": {
id: "anchors.md";
slug: "อุปกรณ์แขวนท่อ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"ball-jet.md": {
id: "ball-jet.md";
slug: "อุปกรณ์ปรับอากาศ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"durgo.md": {
id: "durgo.md";
slug: "อุปกรณ์ปรับอากาศ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"extinguishers.md": {
id: "extinguishers.md";
slug: "อุปกรณ์ดับเพลิง";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"fencing.md": {
id: "fencing.md";
slug: "ระบบรั้ว";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"grilles.md": {
id: "grilles.md";
slug: "อุปกรณ์ปรับอากาศ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"hdpe.md": {
id: "hdpe.md";
slug: "ท่อ-hdpe";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"level-clamp.md": {
id: "level-clamp.md";
slug: "อุปกรณ์แขวนท่อ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"pipe-coupling-machine.md": {
id: "pipe-coupling-machine.md";
slug: "เครื่องจักร";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"poloplast.md": {
id: "poloplast.md";
slug: "ท่อพีพีอาร์";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"sleeve-anchor.md": {
id: "sleeve-anchor.md";
slug: "อุปกรณ์แขวนท่อ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"syler.md": {
id: "syler.md";
slug: "ท่อไซเลอร์";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"tevada.md": {
id: "tevada.md";
slug: "ระบบรั้ว";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"thai-ppr.md": {
id: "thai-ppr.md";
slug: "ท่อพีพีอาร์";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"thermobreak.md": {
id: "thermobreak.md";
slug: "อุปกรณ์ปรับอากาศ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"threaded-rod.md": {
id: "threaded-rod.md";
slug: "อุปกรณ์แขวนท่อ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"u-bolt.md": {
id: "u-bolt.md";
slug: "อุปกรณ์แขวนท่อ";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"water-pump.md": {
id: "water-pump.md";
slug: "เครื่องจักร";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
"water-treatment.md": {
id: "water-treatment.md";
slug: "เครื่องจักร";
body: string;
collection: "products";
data: any
} & { render(): Render[".md"] };
};
};
type DataEntryMap = {
};
type AnyEntryMap = ContentEntryMap & DataEntryMap;
export type ContentConfig = never;
}

2
dealplustech-astro/.astro/types.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference types="astro/client" />
/// <reference path="astro/content.d.ts" />

View File

@@ -0,0 +1,10 @@
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
export default defineConfig({
integrations: [tailwind()],
output: 'static',
build: {
format: 'file'
}
});

6
dealplustech-astro/dist/404.html vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
const onRequest = (_, next) => next();
export { onRequest };

22
dealplustech-astro/dist/about-us.html vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
import 'kleur/colors';
import 'html-escaper';
import 'clsx';
import './astro/server_BKaehDWP.mjs';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
/* empty css */
import { c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead } from '../chunks/astro/server_BKaehDWP.mjs';
import 'kleur/colors';
import 'html-escaper';
import { $ as $$BaseLayout, a as $$Header, b as $$Footer, c as $$FloatingContact } from '../chunks/FloatingContact_CYVf7xCj.mjs';
export { renderers } from '../renderers.mjs';
const $$404 = createComponent(($$result, $$props, $$slots) => {
return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": "404 - \u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E2B\u0E19\u0E49\u0E32" }, { "default": ($$result2) => renderTemplate` ${renderComponent($$result2, "Header", $$Header, {})} ${maybeRenderHead()}<main class="min-h-[60vh] flex items-center justify-center pt-20"> <div class="text-center px-4"> <h1 class="text-6xl font-bold text-secondary-900 mb-4">404</h1> <h2 class="text-2xl font-bold text-secondary-700 mb-4"></h2> <p class="text-secondary-600 mb-8"></p> <a href="/" class="btn-primary"></a> </div> </main> ${renderComponent($$result2, "Footer", $$Footer, {})} ${renderComponent($$result2, "FloatingContact", $$FloatingContact, {})} ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/404.astro", void 0);
const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/404.astro";
const $$url = "/404.html";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$404,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };

View File

@@ -0,0 +1,40 @@
/* empty css */
import { c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead, b as addAttribute } from '../chunks/astro/server_BKaehDWP.mjs';
import 'kleur/colors';
import 'html-escaper';
import { $ as $$BaseLayout, s as siteConfig, a as $$Header, b as $$Footer, c as $$FloatingContact } from '../chunks/FloatingContact_CYVf7xCj.mjs';
export { renderers } from '../renderers.mjs';
const $$Index = createComponent(($$result, $$props, $$slots) => {
return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": "\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E40\u0E23\u0E32", "description": "\u0E40\u0E23\u0E35\u0E22\u0E19\u0E23\u0E39\u0E49\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E14\u0E35\u0E25\u0E1E\u0E25\u0E31\u0E2A\u0E40\u0E17\u0E04 \u0E1C\u0E39\u0E49\u0E40\u0E0A\u0E35\u0E48\u0E22\u0E27\u0E0A\u0E32\u0E0D\u0E14\u0E49\u0E32\u0E19\u0E27\u0E31\u0E2A\u0E14\u0E38\u0E17\u0E48\u0E2D\u0E41\u0E25\u0E30\u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E23\u0E30\u0E1A\u0E1A\u0E17\u0E48\u0E2D" }, { "default": ($$result2) => renderTemplate` ${renderComponent($$result2, "Header", $$Header, {})} ${maybeRenderHead()}<main class="pt-32 pb-16"> <div class="container mx-auto px-4"> <div class="relative h-[400px] -mt-32 mb-12 rounded-b-3xl overflow-hidden"> <div class="absolute inset-0 bg-gradient-to-r from-secondary-900 via-secondary-800 to-secondary-900"></div> <div class="absolute inset-0 flex items-center justify-center"> <div class="text-center"> <h1 class="text-4xl md:text-5xl font-bold text-white mb-4">
เกยวก<span class="text-primary-400">${siteConfig.name}</span> </h1> <p class="text-xl text-secondary-200">
เชยวชาญดานวสดอและอปกรณระบบท
</p> </div> </div> </div> <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 mb-16"> <div> <h2 class="text-3xl font-bold text-secondary-900 mb-6"></h2> <div class="space-y-4 text-secondary-600"> <p> ${siteConfig.nameTh}
และอปกรณระบบทอคณภาพสงใหบลกคาในประเทศไทย
</p> <p>
วยประสบการณมากกว 10 ในอตสาหกรรม เราไดงสมความเชยวชาญ
และสรางเครอขายความรวมมอกบผผลตชนนำทงในและตางประเทศ
</p> <p>
เรามงมนใหบรการสนคาทานมาตรฐานคณภาพ พรอมคำแนะนำจากทมงานมออาช
เพอใหกคาไดบสนคาทเหมาะสมกบความตองการ
</p> </div> </div> <div class="relative aspect-video bg-secondary-100 rounded-xl overflow-hidden"> <img src="/images/2021/03/hdpe-pipe_000C.jpg" alt="" class="object-cover w-full h-full" loading="lazy"> </div> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-16"> <div class="bg-secondary-800 p-8 rounded-xl"> <h3 class="text-2xl font-bold text-primary-400 mb-4"></h3> <p class="text-secondary-200">
เปนผนำตลาดวสดอและอปกรณระบบทอในประเทศไทย
กคาไววางใจในคณภาพและการบรการ
</p> </div> <div class="bg-secondary-800 p-8 rounded-xl"> <h3 class="text-2xl font-bold text-primary-400 mb-4"></h3> <p class="text-secondary-200">
ดหาสนคาคณภาพส ใหบรการทเปนเล และสรางความพงพอใจสงสดใหกค
</p> </div> </div> <div class="text-center mb-12"> <h2 class="text-3xl font-bold text-secondary-900 mb-8"></h2> <div class="grid grid-cols-1 md:grid-cols-4 gap-6"> <div class="p-6 bg-primary-50 rounded-xl"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path> </svg> </div> <h4 class="font-bold text-secondary-900 mb-2"></h4> <p class="text-secondary-600 text-sm"></p> </div> <div class="p-6 bg-primary-50 rounded-xl"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path> </svg> </div> <h4 class="font-bold text-secondary-900 mb-2"></h4> <p class="text-secondary-600 text-sm"></p> </div> <div class="p-6 bg-primary-50 rounded-xl"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path> </svg> </div> <h4 class="font-bold text-secondary-900 mb-2"></h4> <p class="text-secondary-600 text-sm"></p> </div> <div class="p-6 bg-primary-50 rounded-xl"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path> </svg> </div> <h4 class="font-bold text-secondary-900 mb-2"></h4> <p class="text-secondary-600 text-sm"></p> </div> </div> </div> </div> </main> ${renderComponent($$result2, "Footer", $$Footer, {})} ${renderComponent($$result2, "FloatingContact", $$FloatingContact, {})} ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/about-us/index.astro", void 0);
const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/about-us/index.astro";
const $$url = "/about-us.html";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$Index,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };

View File

@@ -0,0 +1,27 @@
/* empty css */
import { c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead, b as addAttribute } from '../chunks/astro/server_BKaehDWP.mjs';
import 'kleur/colors';
import 'html-escaper';
import { $ as $$BaseLayout, s as siteConfig, a as $$Header, w as workHours, b as $$Footer, c as $$FloatingContact } from '../chunks/FloatingContact_CYVf7xCj.mjs';
export { renderers } from '../renderers.mjs';
const $$Index = createComponent(($$result, $$props, $$slots) => {
return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E40\u0E23\u0E32", "description": "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E14\u0E35\u0E25\u0E1E\u0E25\u0E31\u0E2A\u0E40\u0E17\u0E04 \u0E2A\u0E2D\u0E1A\u0E16\u0E32\u0E21\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u0E02\u0E2D\u0E43\u0E1A\u0E40\u0E2A\u0E19\u0E2D\u0E23\u0E32\u0E04\u0E32 \u0E2B\u0E23\u0E37\u0E2D\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E17\u0E35\u0E21\u0E07\u0E32\u0E19" }, { "default": ($$result2) => renderTemplate` ${renderComponent($$result2, "Header", $$Header, {})} ${maybeRenderHead()}<main class="pt-32 pb-16"> <div class="container mx-auto px-4"> <div class="text-center mb-12"> <h1 class="text-4xl md:text-5xl font-bold text-secondary-900 mb-4">
ดต<span class="text-primary-600">เรา</span> </h1> <p class="text-xl text-secondary-600 max-w-2xl mx-auto">
พรอมใหบรการทกว สอบถามขอมลสนคาและขอใบเสนอราคาไดเลย
</p> </div> <div class="max-w-2xl mx-auto"> <div class="bg-secondary-800 rounded-2xl p-8 mb-8"> <h2 class="text-2xl font-bold text-white mb-6"></h2> <div class="space-y-6"> <div class="flex items-start gap-4"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center flex-shrink-0"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path> </svg> </div> <div> <h3 class="font-bold text-white"></h3> <p class="text-secondary-300">${siteConfig.address}</p> </div> </div> <div class="flex items-start gap-4"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center flex-shrink-0"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"></path> </svg> </div> <div> <h3 class="font-bold text-white"></h3> <a${addAttribute(`tel:${siteConfig.phone}`, "href")} class="text-primary-400 hover:text-primary-300">${siteConfig.phone}</a> </div> </div> <div class="flex items-start gap-4"> <div class="w-12 h-12 bg-primary-600 rounded-lg flex items-center justify-center flex-shrink-0"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path> </svg> </div> <div> <h3 class="font-bold text-white"></h3> <a${addAttribute(`mailto:${siteConfig.email}`, "href")} class="text-primary-400 hover:text-primary-300">${siteConfig.email}</a> </div> </div> <div class="flex items-start gap-4"> <div class="w-12 h-12 bg-[#00B900] rounded-lg flex items-center justify-center flex-shrink-0"> <svg class="w-6 h-6 text-white" viewBox="0 0 24 24" fill="currentColor"> <path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.7550 .63.283.63.63 0 .c.349 344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016c0 .27-.174.51-.432.596-.064.021-.133.031-.199.031-.211 0-.391-.09-.51-.25l-2.443-3.317v2.94c0 .344-.279.629-.631.629-.346 0-.626-.285-.626-.629V8.108c0-.27.173-.51.43-.595.06-.023.136-.033.194-.033.195 0 .375.104.495.254l2.462 3.33V8.108c0-.345.282-.63.63-.63.345 0 .63.285.63.63v4.771zm-5.741 0c0 .344-.282.629-.631.629-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63.346 0 .628.285.628.63v4.771zm-2.466.629H4.917c-.345 0-.63-.285-.63-.629V8.108c0-.345.285-.63.63-.63.348 0 .63.285.63.63v4.141h1.756c.348 0 .629.283.629.63 0 .344-.282.629-.629.629M24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"></path> </svg> </div> <div> <h3 class="font-bold text-white">LINE Official</h3> <a${addAttribute(`https://line.me/ti/p/${siteConfig.lineId}`, "href")} target="_blank" rel="noopener" class="text-primary-400 hover:text-primary-300">${siteConfig.lineId}</a> </div> </div> </div> </div> <div class="bg-primary-600 rounded-2xl p-8"> <h2 class="text-2xl font-bold text-white mb-6"></h2> <ul class="space-y-3"> ${workHours.map((item) => renderTemplate`<li class="flex justify-between"> <span class="text-primary-100">${item.day}</span> <span${addAttribute(`font-semibold ${item.isClosed ? "text-red-200" : "text-white"}`, "class")}>${item.hours}</span> </li>`)} </ul> </div> </div> </div> </main> ${renderComponent($$result2, "Footer", $$Footer, {})} ${renderComponent($$result2, "FloatingContact", $$FloatingContact, {})} ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/contact-us/index.astro", void 0);
const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/contact-us/index.astro";
const $$url = "/contact-us.html";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$Index,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };

View File

@@ -0,0 +1,59 @@
/* empty css */
import { c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead, b as addAttribute } from '../chunks/astro/server_BKaehDWP.mjs';
import 'kleur/colors';
import 'html-escaper';
import { $ as $$BaseLayout, s as siteConfig, a as $$Header, d as productCategories, b as $$Footer, c as $$FloatingContact } from '../chunks/FloatingContact_CYVf7xCj.mjs';
export { renderers } from '../renderers.mjs';
const $$Index = createComponent(($$result, $$props, $$slots) => {
return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": "\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01", "description": "\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17 \u0E14\u0E35\u0E25 \u0E1E\u0E25\u0E31\u0E2A \u0E40\u0E17\u0E04 \u0E08\u0E33\u0E01\u0E31\u0E14 - \u0E1C\u0E39\u0E49\u0E40\u0E0A\u0E35\u0E48\u0E22\u0E27\u0E0A\u0E32\u0E0D\u0E14\u0E49\u0E32\u0E19\u0E23\u0E30\u0E1A\u0E1A\u0E17\u0E48\u0E2D\u0E41\u0E25\u0E30 HVAC" }, { "default": ($$result2) => renderTemplate` ${renderComponent($$result2, "Header", $$Header, {})} ${maybeRenderHead()}<main> <!-- Hero Section --> <section class="relative h-[70vh] min-h-[500px] bg-secondary-900"> <div class="absolute inset-0 bg-gradient-to-r from-secondary-900 via-secondary-900/90 to-secondary-900/60 z-10"></div> <img src="/images/2021/03/ppr-pipe_000C.jpg" alt="" class="absolute inset-0 w-full h-full object-cover opacity-50" loading="eager"> <div class="relative z-20 container mx-auto px-4 h-full flex items-center"> <div class="max-w-2xl"> <span class="inline-block px-4 py-2 bg-primary-600 text-white font-semibold mb-4 rounded">
เชยวชาญดานระบบทอและ HVAC
</span> <h1 class="text-4xl md:text-5xl lg:text-6xl font-bold text-white mb-6 leading-tight">
สด ปกรณ HVAC
<span class="text-primary-400 block">และฉนวนหมท</span> </h1> <p class="text-lg md:text-xl text-secondary-200 mb-8">
จำหนายและตดตงท PPR, HDPE, กรลแอร, เทอรโมเบรค และอปกรณระบบทอครบวงจร พรอมบรการใหคำปรกษาจากทมมออาช
</p> <div class="flex flex-wrap gap-4"> <a href="/product/" class="btn-primary">
นคาทงหมด
</a> <a href="/contact-us/" class="btn-outline border-white text-white hover:bg-white hover:text-secondary-900">
ขอใบเสนอราคา
</a> </div> </div> </div> </section> <!-- Features Section --> <section class="py-16 bg-secondary-800"> <div class="container mx-auto px-4"> <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> <div class="text-center p-6"> <div class="w-16 h-16 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-8 h-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"></path> </svg> </div> <h3 class="text-xl font-bold text-white mb-2"></h3> <p class="text-secondary-300">
นคาทกชนผานมาตรฐานคณภาพ พรอมรบประก
</p> </div> <div class="text-center p-6"> <div class="w-16 h-16 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-8 h-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M13 10V3L4 14h7v7l9-11h-7z"></path> </svg> </div> <h3 class="text-xl font-bold text-white mb-2"></h3> <p class="text-secondary-300">
ดสงสนคาทวประเทศ รวดเรวและปลอดภ
</p> </div> <div class="text-center p-6"> <div class="w-16 h-16 bg-primary-600 rounded-lg flex items-center justify-center mx-auto mb-4"> <svg class="w-8 h-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"></path> </svg> </div> <h3 class="text-xl font-bold text-white mb-2"></h3> <p class="text-secondary-300">
มงานพรอมใหคำปรกษาและดแลอยางตอเนอง
</p> </div> </div> </div> </section> <!-- Featured Products Section --> <section class="py-16 bg-secondary-50"> <div class="container mx-auto px-4"> <div class="text-center mb-12"> <h2 class="text-3xl md:text-4xl font-bold text-secondary-900 mb-4">
นค<span class="text-primary-600">เด</span> </h2> <p class="text-secondary-600 text-lg"></p> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> ${productCategories.slice(0, 3).map((product) => renderTemplate`<a${addAttribute(product.href, "href")} class="card group"> <div class="relative aspect-video bg-secondary-100 overflow-hidden"> <img${addAttribute(product.image, "src")}${addAttribute(product.name, "alt")} class="object-cover w-full h-48 group-hover:scale-105 transition-transform duration-300" loading="lazy"> </div> <div class="p-6"> <span class="text-xs text-primary-600 font-semibold">${product.nameEn}</span> <h3 class="text-lg font-bold text-secondary-900 mt-1 group-hover:text-primary-600 transition-colors"> ${product.name} </h3> <p class="mt-2 text-sm text-secondary-600 line-clamp-2"> ${product.shortDescription || product.description} </p> <div class="mt-4 flex items-center text-primary-600 font-medium"> <span></span> <svg class="w-4 h-4 ml-2 group-hover:translate-x-1 transition-transform" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M9 5l7 7-7 7"></path> </svg> </div> </div> </a>`)} </div> <div class="text-center mt-12"> <a href="/product/" class="btn-secondary">
นคาทงหมด
</a> </div> </div> </section> <!-- CTA Section --> <section class="py-16 bg-primary-600"> <div class="container mx-auto px-4 text-center"> <h2 class="text-3xl md:text-4xl font-bold text-white mb-4">
พรอมเรมโครงการของค?
</h2> <p class="text-primary-100 text-lg mb-8 max-w-2xl mx-auto">
ดตอเราวนนเพอรบคำปรกษาและใบเสนอราคาฟร
</p> <div class="flex flex-wrap justify-center gap-4"> <a${addAttribute(`tel:${siteConfig.phone}`, "href")} class="btn-secondary bg-white text-primary-600 hover:bg-primary-50">
โทรหาเรา: ${siteConfig.phone} </a> <a href="/contact-us/" class="btn-outline border-white text-white hover:bg-white hover:text-primary-600">
งขอความ
</a> </div> </div> </section> <!-- About Section --> <section class="py-16"> <div class="container mx-auto px-4"> <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center"> <div> <h2 class="text-3xl md:text-4xl font-bold text-secondary-900 mb-6">
เกยวก<span class="text-primary-600">${siteConfig.nameTh}</span> </h2> <p class="text-secondary-600 mb-4"> ${siteConfig.nameTh}
วยประสบการณมากกว 10 เรามงมนใหบรการสนคาคณภาพส
พรอมคำแนะนำจากทมงานมออาช
</p> <p class="text-secondary-600 mb-6">
เราจำหนายทอพอาร HDPE PVC วาล และอปกรณอทอหลากหลายประเภท
รวมถงอปกรณแขวนทอและอปกรณปรบอากาศ
</p> <a href="/about-us/" class="btn-primary">
เรยนรเพมเต
</a> </div> <div class="relative aspect-video bg-secondary-100 rounded-xl overflow-hidden"> <img src="/images/2021/03/hdpe-pipe_000C.jpg" alt="" class="object-cover w-full h-full" loading="lazy"> </div> </div> </div> </section> </main> ${renderComponent($$result2, "Footer", $$Footer, {})} ${renderComponent($$result2, "FloatingContact", $$FloatingContact, {})} ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/index.astro", void 0);
const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/index.astro";
const $$url = "";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$Index,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
/* empty css */
import { c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead, b as addAttribute } from '../chunks/astro/server_BKaehDWP.mjs';
import 'kleur/colors';
import 'html-escaper';
import { $ as $$BaseLayout, a as $$Header, p as portfolioProjects, b as $$Footer, c as $$FloatingContact } from '../chunks/FloatingContact_CYVf7xCj.mjs';
export { renderers } from '../renderers.mjs';
const $$Index = createComponent(($$result, $$props, $$slots) => {
return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": "\u0E1C\u0E25\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E40\u0E23\u0E32", "description": "\u0E1C\u0E25\u0E07\u0E32\u0E19\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23\u0E15\u0E48\u0E32\u0E07\u0E46 \u0E17\u0E35\u0E48\u0E14\u0E35\u0E25\u0E1E\u0E25\u0E31\u0E2A\u0E40\u0E17\u0E04\u0E44\u0E14\u0E49\u0E23\u0E48\u0E27\u0E21\u0E40\u0E1B\u0E47\u0E19\u0E2A\u0E48\u0E27\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07" }, { "default": ($$result2) => renderTemplate` ${renderComponent($$result2, "Header", $$Header, {})} ${maybeRenderHead()}<main class="pt-32 pb-16"> <div class="container mx-auto px-4"> <div class="text-center mb-12"> <h1 class="text-4xl md:text-5xl font-bold text-secondary-900 mb-4">
ผลงาน<span class="text-primary-600">ของเรา</span> </h1> <p class="text-xl text-secondary-600 max-w-2xl mx-auto">
โครงการตางๆ เราไดวมเปนสวนหนงในการจดหาวสด
</p> </div> <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> ${portfolioProjects.map((project) => renderTemplate`<a${addAttribute(project.href, "href")} class="card group cursor-pointer overflow-hidden"> <div class="relative aspect-video bg-secondary-100 overflow-hidden"> <img${addAttribute(project.image, "src")}${addAttribute(project.name, "alt")} class="object-cover w-full h-full group-hover:scale-105 transition-transform duration-300" loading="lazy"> <div class="absolute inset-0 bg-gradient-to-t from-secondary-900/80 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div> <div class="absolute bottom-0 left-0 right-0 p-4 translate-y-full group-hover:translate-y-0 transition-transform duration-300"> <h3 class="text-white font-bold">${project.name}</h3> </div> </div> <div class="p-4 bg-white group-hover:hidden"> <h3 class="text-lg font-bold text-secondary-900 mt-1">${project.name}</h3> <p class="text-sm text-secondary-600 mt-2 line-clamp-2">${project.description}</p> </div> </a>`)} </div> </div> </main> ${renderComponent($$result2, "Footer", $$Footer, {})} ${renderComponent($$result2, "FloatingContact", $$FloatingContact, {})} ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/portfolio/index.astro", void 0);
const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/portfolio/index.astro";
const $$url = "/portfolio.html";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$Index,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };

View File

@@ -0,0 +1,27 @@
/* empty css */
import { c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead, b as addAttribute } from '../chunks/astro/server_BKaehDWP.mjs';
import 'kleur/colors';
import 'html-escaper';
import { $ as $$BaseLayout, a as $$Header, d as productCategories, b as $$Footer, c as $$FloatingContact } from '../chunks/FloatingContact_CYVf7xCj.mjs';
export { renderers } from '../renderers.mjs';
const $$Index = createComponent(($$result, $$props, $$slots) => {
return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": "\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 - \u0E17\u0E48\u0E2D\u0E1E\u0E35\u0E1E\u0E35\u0E2D\u0E32\u0E23\u0E4C \u0E17\u0E48\u0E2D HDPE \u0E17\u0E48\u0E2D PVC \u0E27\u0E32\u0E25\u0E4C\u0E27 \u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E17\u0E48\u0E2D", "description": "\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E04\u0E23\u0E1A\u0E27\u0E07\u0E08\u0E23 \u0E17\u0E48\u0E2D\u0E1E\u0E35\u0E1E\u0E35\u0E2D\u0E32\u0E23\u0E4C \u0E17\u0E48\u0E2D HDPE \u0E17\u0E48\u0E2D PVC \u0E27\u0E32\u0E25\u0E4C\u0E27 \u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E41\u0E02\u0E27\u0E19\u0E17\u0E48\u0E2D \u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E1B\u0E23\u0E31\u0E1A\u0E2D\u0E32\u0E01\u0E32\u0E28 \u0E41\u0E25\u0E30\u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E14\u0E31\u0E1A\u0E40\u0E1E\u0E25\u0E34\u0E07" }, { "default": ($$result2) => renderTemplate` ${renderComponent($$result2, "Header", $$Header, {})} ${maybeRenderHead()}<main class="pt-32 pb-16"> <div class="container mx-auto px-4"> <div class="text-center mb-12"> <h1 class="text-4xl md:text-5xl font-bold text-secondary-900 mb-4">
นค<span class="text-primary-600">งหมด</span> </h1> <p class="text-xl text-secondary-600 max-w-2xl mx-auto">
สดอและอปกรณระบบทอคณภาพสงครบวงจร
</p> </div> <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"> ${productCategories.map((product) => renderTemplate`<a${addAttribute(product.href, "href")} class="card group"> <div class="relative aspect-video bg-secondary-100"> <img${addAttribute(product.image, "src")}${addAttribute(product.name, "alt")} class="object-cover w-full h-full group-hover:scale-105 transition-transform duration-300" loading="lazy"> </div> <div class="p-4"> <span class="text-xs text-primary-600 font-semibold">${product.nameEn}</span> <h3 class="text-lg font-bold text-secondary-900 mt-1 group-hover:text-primary-600 transition-colors"> ${product.name} </h3> <p class="text-secondary-600 text-sm mt-2 line-clamp-2"> ${product.shortDescription || product.description} </p> </div> </a>`)} </div> </div> </main> ${renderComponent($$result2, "Footer", $$Footer, {})} ${renderComponent($$result2, "FloatingContact", $$FloatingContact, {})} ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/product/index.astro", void 0);
const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/dealplustech-astro/src/pages/product/index.astro";
const $$url = "/product.html";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$Index,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dealplustech-astro/dist/renderers.mjs vendored Normal file
View File

@@ -0,0 +1,3 @@
const renderers = [];
export { renderers };

1
dealplustech-astro/node_modules/.bin/acorn generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../acorn/bin/acorn

1
dealplustech-astro/node_modules/.bin/astro generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../astro/astro.js

1
dealplustech-astro/node_modules/.bin/autoprefixer generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../autoprefixer/bin/autoprefixer

View File

@@ -0,0 +1 @@
../baseline-browser-mapping/dist/cli.cjs

1
dealplustech-astro/node_modules/.bin/browserslist generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../browserslist/cli.js

1
dealplustech-astro/node_modules/.bin/cssesc generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../cssesc/bin/cssesc

1
dealplustech-astro/node_modules/.bin/esbuild generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../esbuild/bin/esbuild

1
dealplustech-astro/node_modules/.bin/esparse generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../esprima/bin/esparse.js

1
dealplustech-astro/node_modules/.bin/esvalidate generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../esprima/bin/esvalidate.js

1
dealplustech-astro/node_modules/.bin/is-docker generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../is-docker/cli.js

View File

@@ -0,0 +1 @@
../is-inside-container/cli.js

1
dealplustech-astro/node_modules/.bin/jiti generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../jiti/bin/jiti.js

1
dealplustech-astro/node_modules/.bin/js-yaml generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js

1
dealplustech-astro/node_modules/.bin/jsesc generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../jsesc/bin/jsesc

1
dealplustech-astro/node_modules/.bin/json5 generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../json5/lib/cli.js

1
dealplustech-astro/node_modules/.bin/nanoid generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../nanoid/bin/nanoid.cjs

1
dealplustech-astro/node_modules/.bin/parser generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../@babel/parser/bin/babel-parser.js

1
dealplustech-astro/node_modules/.bin/resolve generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../resolve/bin/resolve

1
dealplustech-astro/node_modules/.bin/rollup generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../rollup/dist/bin/rollup

1
dealplustech-astro/node_modules/.bin/semver generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../semver/bin/semver.js

1
dealplustech-astro/node_modules/.bin/sucrase generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../sucrase/bin/sucrase

1
dealplustech-astro/node_modules/.bin/sucrase-node generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../sucrase/bin/sucrase-node

1
dealplustech-astro/node_modules/.bin/tailwind generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../tailwindcss/lib/cli.js

1
dealplustech-astro/node_modules/.bin/tailwindcss generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../tailwindcss/lib/cli.js

1
dealplustech-astro/node_modules/.bin/tsc generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../typescript/bin/tsc

1
dealplustech-astro/node_modules/.bin/tsconfck generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../tsconfck/bin/tsconfck.js

1
dealplustech-astro/node_modules/.bin/tsserver generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../typescript/bin/tsserver

View File

@@ -0,0 +1 @@
../update-browserslist-db/cli.js

1
dealplustech-astro/node_modules/.bin/vite generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../vite/bin/vite.js

1
dealplustech-astro/node_modules/.bin/yaml generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../yaml/bin.mjs

6178
dealplustech-astro/node_modules/.package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,128 @@
declare namespace QuickLRU {
interface Options<KeyType, ValueType> {
/**
The maximum number of milliseconds an item should remain in the cache.
@default Infinity
By default, `maxAge` will be `Infinity`, which means that items will never expire.
Lazy expiration upon the next write or read call.
Individual expiration of an item can be specified by the `set(key, value, maxAge)` method.
*/
readonly maxAge?: number;
/**
The maximum number of items before evicting the least recently used items.
*/
readonly maxSize: number;
/**
Called right before an item is evicted from the cache.
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
*/
onEviction?: (key: KeyType, value: ValueType) => void;
}
}
declare class QuickLRU<KeyType, ValueType>
implements Iterable<[KeyType, ValueType]> {
/**
The stored item count.
*/
readonly size: number;
/**
Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
@example
```
import QuickLRU = require('quick-lru');
const lru = new QuickLRU({maxSize: 1000});
lru.set('🦄', '🌈');
lru.has('🦄');
//=> true
lru.get('🦄');
//=> '🌈'
```
*/
constructor(options: QuickLRU.Options<KeyType, ValueType>);
[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;
/**
Set an item. Returns the instance.
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire.
@returns The list instance.
*/
set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this;
/**
Get an item.
@returns The stored item or `undefined`.
*/
get(key: KeyType): ValueType | undefined;
/**
Check if an item exists.
*/
has(key: KeyType): boolean;
/**
Get an item without marking it as recently used.
@returns The stored item or `undefined`.
*/
peek(key: KeyType): ValueType | undefined;
/**
Delete an item.
@returns `true` if the item is removed or `false` if the item doesn't exist.
*/
delete(key: KeyType): boolean;
/**
Delete all items.
*/
clear(): void;
/**
Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
Useful for on-the-fly tuning of cache sizes in live systems.
*/
resize(maxSize: number): void;
/**
Iterable for all the keys.
*/
keys(): IterableIterator<KeyType>;
/**
Iterable for all the values.
*/
values(): IterableIterator<ValueType>;
/**
Iterable for all entries, starting with the oldest (ascending in recency).
*/
entriesAscending(): IterableIterator<[KeyType, ValueType]>;
/**
Iterable for all entries, starting with the newest (descending in recency).
*/
entriesDescending(): IterableIterator<[KeyType, ValueType]>;
}
export = QuickLRU;

View File

@@ -0,0 +1,263 @@
'use strict';
class QuickLRU {
constructor(options = {}) {
if (!(options.maxSize && options.maxSize > 0)) {
throw new TypeError('`maxSize` must be a number greater than 0');
}
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
throw new TypeError('`maxAge` must be a number greater than 0');
}
this.maxSize = options.maxSize;
this.maxAge = options.maxAge || Infinity;
this.onEviction = options.onEviction;
this.cache = new Map();
this.oldCache = new Map();
this._size = 0;
}
_emitEvictions(cache) {
if (typeof this.onEviction !== 'function') {
return;
}
for (const [key, item] of cache) {
this.onEviction(key, item.value);
}
}
_deleteIfExpired(key, item) {
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
if (typeof this.onEviction === 'function') {
this.onEviction(key, item.value);
}
return this.delete(key);
}
return false;
}
_getOrDeleteIfExpired(key, item) {
const deleted = this._deleteIfExpired(key, item);
if (deleted === false) {
return item.value;
}
}
_getItemValue(key, item) {
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
}
_peek(key, cache) {
const item = cache.get(key);
return this._getItemValue(key, item);
}
_set(key, value) {
this.cache.set(key, value);
this._size++;
if (this._size >= this.maxSize) {
this._size = 0;
this._emitEvictions(this.oldCache);
this.oldCache = this.cache;
this.cache = new Map();
}
}
_moveToRecent(key, item) {
this.oldCache.delete(key);
this._set(key, item);
}
* _entriesAscending() {
for (const item of this.oldCache) {
const [key, value] = item;
if (!this.cache.has(key)) {
const deleted = this._deleteIfExpired(key, value);
if (deleted === false) {
yield item;
}
}
}
for (const item of this.cache) {
const [key, value] = item;
const deleted = this._deleteIfExpired(key, value);
if (deleted === false) {
yield item;
}
}
}
get(key) {
if (this.cache.has(key)) {
const item = this.cache.get(key);
return this._getItemValue(key, item);
}
if (this.oldCache.has(key)) {
const item = this.oldCache.get(key);
if (this._deleteIfExpired(key, item) === false) {
this._moveToRecent(key, item);
return item.value;
}
}
}
set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) {
if (this.cache.has(key)) {
this.cache.set(key, {
value,
maxAge
});
} else {
this._set(key, {value, expiry: maxAge});
}
}
has(key) {
if (this.cache.has(key)) {
return !this._deleteIfExpired(key, this.cache.get(key));
}
if (this.oldCache.has(key)) {
return !this._deleteIfExpired(key, this.oldCache.get(key));
}
return false;
}
peek(key) {
if (this.cache.has(key)) {
return this._peek(key, this.cache);
}
if (this.oldCache.has(key)) {
return this._peek(key, this.oldCache);
}
}
delete(key) {
const deleted = this.cache.delete(key);
if (deleted) {
this._size--;
}
return this.oldCache.delete(key) || deleted;
}
clear() {
this.cache.clear();
this.oldCache.clear();
this._size = 0;
}
resize(newSize) {
if (!(newSize && newSize > 0)) {
throw new TypeError('`maxSize` must be a number greater than 0');
}
const items = [...this._entriesAscending()];
const removeCount = items.length - newSize;
if (removeCount < 0) {
this.cache = new Map(items);
this.oldCache = new Map();
this._size = items.length;
} else {
if (removeCount > 0) {
this._emitEvictions(items.slice(0, removeCount));
}
this.oldCache = new Map(items.slice(removeCount));
this.cache = new Map();
this._size = 0;
}
this.maxSize = newSize;
}
* keys() {
for (const [key] of this) {
yield key;
}
}
* values() {
for (const [, value] of this) {
yield value;
}
}
* [Symbol.iterator]() {
for (const item of this.cache) {
const [key, value] = item;
const deleted = this._deleteIfExpired(key, value);
if (deleted === false) {
yield [key, value.value];
}
}
for (const item of this.oldCache) {
const [key, value] = item;
if (!this.cache.has(key)) {
const deleted = this._deleteIfExpired(key, value);
if (deleted === false) {
yield [key, value.value];
}
}
}
}
* entriesDescending() {
let items = [...this.cache];
for (let i = items.length - 1; i >= 0; --i) {
const item = items[i];
const [key, value] = item;
const deleted = this._deleteIfExpired(key, value);
if (deleted === false) {
yield [key, value.value];
}
}
items = [...this.oldCache];
for (let i = items.length - 1; i >= 0; --i) {
const item = items[i];
const [key, value] = item;
if (!this.cache.has(key)) {
const deleted = this._deleteIfExpired(key, value);
if (deleted === false) {
yield [key, value.value];
}
}
}
}
* entriesAscending() {
for (const [key, value] of this._entriesAscending()) {
yield [key, value.value];
}
}
get size() {
if (!this._size) {
return this.oldCache.size;
}
let oldCacheSize = 0;
for (const key of this.oldCache.keys()) {
if (!this.cache.has(key)) {
oldCacheSize++;
}
}
return Math.min(this._size + oldCacheSize, this.maxSize);
}
}
module.exports = QuickLRU;

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,43 @@
{
"name": "@alloc/quick-lru",
"version": "5.2.0",
"description": "Simple “Least Recently Used” (LRU) cache",
"license": "MIT",
"repository": "sindresorhus/quick-lru",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && nyc ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"lru",
"quick",
"cache",
"caching",
"least",
"recently",
"used",
"fast",
"map",
"hash",
"buffer"
],
"devDependencies": {
"ava": "^2.0.0",
"coveralls": "^3.0.3",
"nyc": "^15.0.0",
"tsd": "^0.11.0",
"xo": "^0.26.0"
}
}

View File

@@ -0,0 +1,139 @@
# quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master)
> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29)
Useful when you need to cache something and limit memory usage.
Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`.
## Install
```
$ npm install quick-lru
```
## Usage
```js
const QuickLRU = require('quick-lru');
const lru = new QuickLRU({maxSize: 1000});
lru.set('🦄', '🌈');
lru.has('🦄');
//=> true
lru.get('🦄');
//=> '🌈'
```
## API
### new QuickLRU(options?)
Returns a new instance.
### options
Type: `object`
#### maxSize
*Required*\
Type: `number`
The maximum number of items before evicting the least recently used items.
#### maxAge
Type: `number`\
Default: `Infinity`
The maximum number of milliseconds an item should remain in cache.
By default maxAge will be Infinity, which means that items will never expire.
Lazy expiration happens upon the next `write` or `read` call.
Individual expiration of an item can be specified by the `set(key, value, options)` method.
#### onEviction
*Optional*\
Type: `(key, value) => void`
Called right before an item is evicted from the cache.
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
### Instance
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
Both `key` and `value` can be of any type.
#### .set(key, value, options?)
Set an item. Returns the instance.
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire.
#### .get(key)
Get an item.
#### .has(key)
Check if an item exists.
#### .peek(key)
Get an item without marking it as recently used.
#### .delete(key)
Delete an item.
Returns `true` if the item is removed or `false` if the item doesn't exist.
#### .clear()
Delete all items.
#### .resize(maxSize)
Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
Useful for on-the-fly tuning of cache sizes in live systems.
#### .keys()
Iterable for all the keys.
#### .values()
Iterable for all the values.
#### .entriesAscending()
Iterable for all entries, starting with the oldest (ascending in recency).
#### .entriesDescending()
Iterable for all entries, starting with the newest (descending in recency).
#### .size
The stored item count.
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-quick-lru?utm_source=npm-quick-lru&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

View File

@@ -0,0 +1,53 @@
MIT License
Copyright (c) 2021 [Astro contributors](https://github.com/withastro/compiler/graphs/contributors)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
This license applies to parts of the `internal/` subdirectory originating from
the https://cs.opensource.google/go/x/net/+/master:html/ repository:
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,72 @@
# Astro Compiler
Astros [Go](https://golang.org/) + WASM compiler.
## Install
```
npm install @astrojs/compiler
```
## Usage
#### Transform `.astro` to valid TypeScript
The Astro compiler can convert `.astro` syntax to a TypeScript Module whose default export generates HTML.
**Some notes**...
- TypeScript is valid `.astro` syntax! The output code may need an additional post-processing step to generate valid JavaScript.
- `.astro` files rely on a server implementation exposed as `astro/runtime/server/index.js` in the Node ecosystem. Other runtimes currently need to bring their own rendering implementation and reference it via `internalURL`. This is a pain point we're looking into fixing.
```js
import { transform, type TransformResult } from "@astrojs/compiler";
const result = await transform(source, {
filename: "/Users/astro/Code/project/src/pages/index.astro",
sourcemap: "both",
internalURL: "astro/runtime/server/index.js",
});
```
#### Parse `.astro` and return an AST
The Astro compiler can emit an AST using the `parse` method.
**Some notes**...
- Position data is currently incomplete and in some cases incorrect. We're working on it!
- A `TextNode` can represent both HTML `text` and JavaScript/TypeScript source code.
- The `@astrojs/compiler/utils` entrypoint exposes `walk` and `walkAsync` functions that can be used to traverse the AST. It also exposes the `is` helper which can be used as guards to derive the proper types for each `node`.
```js
import { parse } from "@astrojs/compiler";
import { walk, walkAsync, is } from "@astrojs/compiler/utils";
const result = await parse(source, {
position: false, // defaults to `true`
});
walk(result.ast, (node) => {
// `tag` nodes are `element` | `custom-element` | `component`
if (is.tag(node)) {
console.log(node.name);
}
});
await walkAsync(result.ast, async (node) => {
if (is.tag(node)) {
node.value = await expensiveCalculation(node)
}
});
```
## Develop
### VSCode / CodeSpaces
A `devcontainer` configuration is available for use with VSCode's [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) and GitHub CodeSpaces.
## Contributing
[CONTRIBUTING.md](/CONTRIBUTING.md)

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
import { transform as transform$1, parse as parse$1, convertToTSX as convertToTSX$1, teardown as teardown$1, initialize as initialize$1 } from '../shared/types.js';
import '../shared/ast.js';
import '../shared/diagnostics.js';
declare const transform: typeof transform$1;
declare const parse: typeof parse$1;
declare const convertToTSX: typeof convertToTSX$1;
declare const teardown: typeof teardown$1;
declare const initialize: typeof initialize$1;
export { convertToTSX, initialize, parse, teardown, transform };

View File

@@ -0,0 +1 @@
import{a as f}from"../chunk-QR6QDSEV.js";var u=(t,e)=>p().transform(t,e),S=(t,e)=>p().parse(t,e),v=(t,e)=>p().convertToTSX(t,e),a,i,h=()=>{a=void 0,i=void 0,globalThis["@astrojs/compiler"]=void 0},T=async t=>{let e=t.wasmURL;if(!e)throw new Error('Must provide the "wasmURL" option');e+="",a||(a=m(e).catch(n=>{throw a=void 0,n})),i=i||await a},p=()=>{if(!a)throw new Error('You need to call "initialize" before calling this');if(!i)throw new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this');return i},y=async(t,e)=>{let n;return WebAssembly.instantiateStreaming?n=await WebAssembly.instantiateStreaming(fetch(t),e):n=await(async()=>{let s=await fetch(t).then(o=>o.arrayBuffer());return WebAssembly.instantiate(s,e)})(),n},m=async t=>{let e=new f,n=await y(t,e.importObject);e.run(n.instance);let c=globalThis["@astrojs/compiler"];return{transform:(s,o)=>new Promise(r=>r(c.transform(s,o||{}))),convertToTSX:(s,o)=>new Promise(r=>r(c.convertToTSX(s,o||{}))).then(r=>({...r,map:JSON.parse(r.map)})),parse:(s,o)=>new Promise(r=>r(c.parse(s,o||{}))).then(r=>({...r,ast:JSON.parse(r.ast)}))}};export{v as convertToTSX,T as initialize,S as parse,h as teardown,u as transform};

View File

@@ -0,0 +1,3 @@
"use strict";var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var t in e)c(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(o,r)&&r!==t&&c(o,r,{get:()=>e[r],enumerable:!(a=d(e,r))||a.enumerable});return o};var y=o=>f(c({},"__esModule",{value:!0}),o);var v={};u(v,{is:()=>s,serialize:()=>k,walk:()=>h,walkAsync:()=>x});module.exports=y(v);function n(o){return e=>e.type===o}var s={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:n("root"),element:n("element"),customElement:n("custom-element"),component:n("component"),fragment:n("fragment"),expression:n("expression"),text:n("text"),doctype:n("doctype"),comment:n("comment"),frontmatter:n("frontmatter")},l=class{constructor(e){this.callback=e}async visit(e,t,a){if(await this.callback(e,t,a),s.parent(e)){let r=[];for(let i=0;i<e.children.length;i++){let m=e.children[i];r.push(this.callback(m,e,i))}await Promise.all(r)}}};function h(o,e){new l(e).visit(o)}function x(o,e){return new l(e).visit(o)}function g(o){let e="";for(let t of o.attributes)switch(e+=" ",t.kind){case"empty":{e+=`${t.name}`;break}case"expression":{e+=`${t.name}={${t.value}}`;break}case"quoted":{e+=`${t.name}=${t.raw}`;break}case"template-literal":{e+=`${t.name}=\`${t.value}\``;break}case"shorthand":{e+=`{${t.name}}`;break}case"spread":{e+=`{...${t.value}}`;break}}return e}function k(o,e={selfClose:!0}){let t="";function a(r){if(s.root(r))for(let i of r.children)a(i);else if(s.frontmatter(r))t+=`---${r.value}---
`;else if(s.comment(r))t+=`<!--${r.value}-->`;else if(s.expression(r)){t+="{";for(let i of r.children)a(i);t+="}"}else if(s.literal(r))t+=r.value;else if(s.tag(r))if(t+=`<${r.name}`,t+=g(r),r.children.length===0&&e.selfClose)t+=" />";else{t+=">";for(let i of r.children)a(i);t+=`</${r.name}>`}}return a(o),t}0&&(module.exports={is,serialize,walk,walkAsync});

View File

@@ -0,0 +1,29 @@
import { Node, ParentNode, LiteralNode, TagLikeNode, TextNode, RootNode, ElementNode, CustomElementNode, ComponentNode, FragmentNode, ExpressionNode, DoctypeNode, CommentNode, FrontmatterNode } from '../shared/ast.js';
type Visitor = (node: Node, parent?: ParentNode, index?: number) => void | Promise<void>;
declare const is: {
parent(node: Node): node is ParentNode;
literal(node: Node): node is LiteralNode;
tag(node: Node): node is TagLikeNode;
whitespace(node: Node): node is TextNode;
root: (node: Node) => node is RootNode;
element: (node: Node) => node is ElementNode;
customElement: (node: Node) => node is CustomElementNode;
component: (node: Node) => node is ComponentNode;
fragment: (node: Node) => node is FragmentNode;
expression: (node: Node) => node is ExpressionNode;
text: (node: Node) => node is TextNode;
doctype: (node: Node) => node is DoctypeNode;
comment: (node: Node) => node is CommentNode;
frontmatter: (node: Node) => node is FrontmatterNode;
};
declare function walk(node: ParentNode, callback: Visitor): void;
declare function walkAsync(node: ParentNode, callback: Visitor): Promise<void>;
interface SerializeOptions {
selfClose: boolean;
}
/** @deprecated Please use `SerializeOptions` */
type SerializeOtions = SerializeOptions;
declare function serialize(root: Node, opts?: SerializeOptions): string;
export { SerializeOptions, SerializeOtions, Visitor, is, serialize, walk, walkAsync };

View File

@@ -0,0 +1,3 @@
function n(o){return t=>t.type===o}var a={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:n("root"),element:n("element"),customElement:n("custom-element"),component:n("component"),fragment:n("fragment"),expression:n("expression"),text:n("text"),doctype:n("doctype"),comment:n("comment"),frontmatter:n("frontmatter")},l=class{constructor(t){this.callback=t}async visit(t,e,s){if(await this.callback(t,e,s),a.parent(t)){let r=[];for(let i=0;i<t.children.length;i++){let c=t.children[i];r.push(this.callback(c,t,i))}await Promise.all(r)}}};function N(o,t){new l(t).visit(o)}function u(o,t){return new l(t).visit(o)}function m(o){let t="";for(let e of o.attributes)switch(t+=" ",e.kind){case"empty":{t+=`${e.name}`;break}case"expression":{t+=`${e.name}={${e.value}}`;break}case"quoted":{t+=`${e.name}=${e.raw}`;break}case"template-literal":{t+=`${e.name}=\`${e.value}\``;break}case"shorthand":{t+=`{${e.name}}`;break}case"spread":{t+=`{...${e.value}}`;break}}return t}function f(o,t={selfClose:!0}){let e="";function s(r){if(a.root(r))for(let i of r.children)s(i);else if(a.frontmatter(r))e+=`---${r.value}---
`;else if(a.comment(r))e+=`<!--${r.value}-->`;else if(a.expression(r)){e+="{";for(let i of r.children)s(i);e+="}"}else if(a.literal(r))e+=r.value;else if(a.tag(r))if(e+=`<${r.name}`,e+=m(r),r.children.length===0&&t.selfClose)e+=" />";else{e+=">";for(let i of r.children)s(i);e+=`</${r.name}>`}}return s(o),e}export{a as is,f as serialize,N as walk,u as walkAsync};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,37 @@
declare class Go {
importObject: {
gojs: {
'runtime.wasmExit': (sp: any) => void;
'runtime.wasmWrite': (sp: any) => void;
'runtime.resetMemoryDataView': (sp: any) => void;
'runtime.nanotime1': (sp: any) => void;
'runtime.walltime': (sp: any) => void;
'runtime.scheduleTimeoutEvent': (sp: any) => void;
'runtime.clearTimeoutEvent': (sp: any) => void;
'runtime.getRandomData': (sp: any) => void;
'syscall/js.finalizeRef': (sp: any) => void;
'syscall/js.stringVal': (sp: any) => void;
'syscall/js.valueGet': (sp: any) => void;
'syscall/js.valueSet': (sp: any) => void;
'syscall/js.valueDelete': (sp: any) => void;
'syscall/js.valueIndex': (sp: any) => void;
'syscall/js.valueSetIndex': (sp: any) => void;
'syscall/js.valueCall': (sp: any) => void;
'syscall/js.valueInvoke': (sp: any) => void;
'syscall/js.valueNew': (sp: any) => void;
'syscall/js.valueLength': (sp: any) => void;
'syscall/js.valuePrepareString': (sp: any) => void;
'syscall/js.valueLoadString': (sp: any) => void;
'syscall/js.valueInstanceOf': (sp: any) => void;
'syscall/js.copyBytesToGo': (sp: any) => void;
'syscall/js.copyBytesToJS': (sp: any) => void;
debug: (value: any) => void;
};
};
constructor();
run(instance: any): Promise<void>;
private _resume;
private _makeFuncWrapper;
}
export { Go as default };

View File

@@ -0,0 +1 @@
import{a}from"../chunk-QR6QDSEV.js";export{a as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
import { transform as transform$1, parse as parse$1, convertToTSX as convertToTSX$1, teardown as teardown$1 } from '../shared/types.js';
export { HoistedScript, ParseOptions, ParseResult, PreprocessorResult, TransformOptions, TransformResult } from '../shared/types.js';
import '../shared/ast.js';
import '../shared/diagnostics.js';
declare const transform: typeof transform$1;
declare const parse: typeof parse$1;
declare const convertToTSX: typeof convertToTSX$1;
declare const compile: (template: string) => Promise<string>;
declare const teardown: typeof teardown$1;
export { compile, convertToTSX, parse, teardown, transform };

View File

@@ -0,0 +1 @@
import{a as c}from"../chunk-W5DTLHV4.js";import{promises as m}from"fs";import{fileURLToPath as f}from"url";var w=async(t,s)=>i().then(r=>r.transform(t,s)),l=async(t,s)=>i().then(r=>r.parse(t,s)),b=async(t,s)=>i().then(r=>r.convertToTSX(t,s)),P=async t=>{let{default:s}=await import(`data:text/javascript;charset=utf-8;base64,${Buffer.from(t).toString("base64")}`);return s},n,g=()=>{n=void 0,globalThis["@astrojs/compiler"]=void 0},i=()=>(n||(n=d().catch(t=>{throw n=void 0,t})),n),y=async(t,s)=>{let r;return r=await(async()=>{let o=await m.readFile(t).then(e=>e.buffer);return WebAssembly.instantiate(new Uint8Array(o),s)})(),r},d=async()=>{let t=new c,s=await y(f(new URL("../astro.wasm",import.meta.url)),t.importObject);t.run(s.instance);let r=globalThis["@astrojs/compiler"];return{transform:(a,o)=>new Promise(e=>{try{e(r.transform(a,o||{}))}catch(p){throw n=void 0,p}}),parse:(a,o)=>new Promise(e=>e(r.parse(a,o||{}))).catch(e=>{throw n=void 0,e}).then(e=>({...e,ast:JSON.parse(e.ast)})),convertToTSX:(a,o)=>new Promise(e=>e(r.convertToTSX(a,o||{}))).catch(e=>{throw n=void 0,e}).then(e=>({...e,map:JSON.parse(e.map)}))}};export{P as compile,b as convertToTSX,l as parse,g as teardown,w as transform};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
import { TransformOptions, TransformResult, ParseOptions, ParseResult, ConvertToTSXOptions, TSXResult, transform as transform$1, parse as parse$1, convertToTSX as convertToTSX$1 } from '../shared/types.js';
import '../shared/ast.js';
import '../shared/diagnostics.js';
type UnwrappedPromise<T> = T extends (...params: any) => Promise<infer Return> ? (...params: Parameters<T>) => Return : T;
interface Service {
transform: UnwrappedPromise<typeof transform$1>;
parse: UnwrappedPromise<typeof parse$1>;
convertToTSX: UnwrappedPromise<typeof convertToTSX$1>;
}
declare const transform: (input: string, options: TransformOptions | undefined) => TransformResult;
declare const parse: (input: string, options: ParseOptions | undefined) => ParseResult;
declare const convertToTSX: (input: string, options: ConvertToTSXOptions | undefined) => TSXResult;
declare function startRunningService(): Service;
export { convertToTSX, parse, startRunningService, transform };

View File

@@ -0,0 +1 @@
import{a as c}from"../chunk-W5DTLHV4.js";import{readFileSync as p}from"fs";import{fileURLToPath as m}from"url";function i(){return s||(s=f()),s}var s,l=(e,t)=>i().transform(e,t),w=(e,t)=>i().parse(e,t),h=(e,t)=>i().convertToTSX(e,t);function f(){let e=new c,t=v(m(new URL("../astro.wasm",import.meta.url)),e.importObject);e.run(t);let o=globalThis["@astrojs/compiler"];return{transform:(n,a)=>{try{return o.transform(n,a||{})}catch(r){throw s=void 0,r}},parse:(n,a)=>{try{let r=o.parse(n,a||{});return{...r,ast:JSON.parse(r.ast)}}catch(r){throw s=void 0,r}},convertToTSX:(n,a)=>{try{let r=o.convertToTSX(n,a||{});return{...r,map:JSON.parse(r.map)}}catch(r){throw s=void 0,r}}}}function v(e,t){let o=p(e);return new WebAssembly.Instance(new WebAssembly.Module(o),t)}export{h as convertToTSX,w as parse,f as startRunningService,l as transform};

View File

@@ -0,0 +1,3 @@
"use strict";var m=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var t in e)m(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(o,r)&&r!==t&&m(o,r,{get:()=>e[r],enumerable:!(a=d(e,r))||a.enumerable});return o};var y=o=>f(m({},"__esModule",{value:!0}),o);var v={};u(v,{is:()=>s,serialize:()=>k,walk:()=>h,walkAsync:()=>x});module.exports=y(v);function n(o){return e=>e.type===o}var s={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:n("root"),element:n("element"),customElement:n("custom-element"),component:n("component"),fragment:n("fragment"),expression:n("expression"),text:n("text"),doctype:n("doctype"),comment:n("comment"),frontmatter:n("frontmatter")},l=class{constructor(e){this.callback=e}async visit(e,t,a){if(await this.callback(e,t,a),s.parent(e)){let r=[];for(let i=0;i<e.children.length;i++){let c=e.children[i];r.push(this.callback(c,e,i))}await Promise.all(r)}}};function h(o,e){new l(e).visit(o)}function x(o,e){return new l(e).visit(o)}function g(o){let e="";for(let t of o.attributes)switch(e+=" ",t.kind){case"empty":{e+=`${t.name}`;break}case"expression":{e+=`${t.name}={${t.value}}`;break}case"quoted":{e+=`${t.name}=${t.raw}`;break}case"template-literal":{e+=`${t.name}=\`${t.value}\``;break}case"shorthand":{e+=`{${t.name}}`;break}case"spread":{e+=`{...${t.name}}`;break}}return e}function k(o,e={selfClose:!0}){let t="";function a(r){if(s.root(r))for(let i of r.children)a(i);else if(s.frontmatter(r))t+=`---${r.value}---
`;else if(s.comment(r))t+=`<!--${r.value}-->`;else if(s.expression(r)){t+="{";for(let i of r.children)a(i);t+="}"}else if(s.literal(r))t+=r.value;else if(s.tag(r))if(t+=`<${r.name}`,t+=g(r),r.children.length===0&&e.selfClose)t+=" />";else{t+=">";for(let i of r.children)a(i);t+=`</${r.name}>`}}return a(o),t}0&&(module.exports={is,serialize,walk,walkAsync});

View File

@@ -0,0 +1,29 @@
import { Node, ParentNode, LiteralNode, TagLikeNode, TextNode, RootNode, ElementNode, CustomElementNode, ComponentNode, FragmentNode, ExpressionNode, DoctypeNode, CommentNode, FrontmatterNode } from '../shared/ast.js';
type Visitor = (node: Node, parent?: ParentNode, index?: number) => void | Promise<void>;
declare const is: {
parent(node: Node): node is ParentNode;
literal(node: Node): node is LiteralNode;
tag(node: Node): node is TagLikeNode;
whitespace(node: Node): node is TextNode;
root: (node: Node) => node is RootNode;
element: (node: Node) => node is ElementNode;
customElement: (node: Node) => node is CustomElementNode;
component: (node: Node) => node is ComponentNode;
fragment: (node: Node) => node is FragmentNode;
expression: (node: Node) => node is ExpressionNode;
text: (node: Node) => node is TextNode;
doctype: (node: Node) => node is DoctypeNode;
comment: (node: Node) => node is CommentNode;
frontmatter: (node: Node) => node is FrontmatterNode;
};
declare function walk(node: ParentNode, callback: Visitor): void;
declare function walkAsync(node: ParentNode, callback: Visitor): Promise<void>;
interface SerializeOptions {
selfClose: boolean;
}
/** @deprecated Please use `SerializeOptions` */
type SerializeOtions = SerializeOptions;
declare function serialize(root: Node, opts?: SerializeOptions): string;
export { SerializeOptions, SerializeOtions, Visitor, is, serialize, walk, walkAsync };

View File

@@ -0,0 +1,3 @@
function n(o){return t=>t.type===o}var a={parent(o){return Array.isArray(o.children)},literal(o){return typeof o.value=="string"},tag(o){return o.type==="element"||o.type==="custom-element"||o.type==="component"||o.type==="fragment"},whitespace(o){return o.type==="text"&&o.value.trim().length===0},root:n("root"),element:n("element"),customElement:n("custom-element"),component:n("component"),fragment:n("fragment"),expression:n("expression"),text:n("text"),doctype:n("doctype"),comment:n("comment"),frontmatter:n("frontmatter")},l=class{constructor(t){this.callback=t}async visit(t,e,s){if(await this.callback(t,e,s),a.parent(t)){let r=[];for(let i=0;i<t.children.length;i++){let m=t.children[i];r.push(this.callback(m,t,i))}await Promise.all(r)}}};function N(o,t){new l(t).visit(o)}function u(o,t){return new l(t).visit(o)}function c(o){let t="";for(let e of o.attributes)switch(t+=" ",e.kind){case"empty":{t+=`${e.name}`;break}case"expression":{t+=`${e.name}={${e.value}}`;break}case"quoted":{t+=`${e.name}=${e.raw}`;break}case"template-literal":{t+=`${e.name}=\`${e.value}\``;break}case"shorthand":{t+=`{${e.name}}`;break}case"spread":{t+=`{...${e.name}}`;break}}return t}function f(o,t={selfClose:!0}){let e="";function s(r){if(a.root(r))for(let i of r.children)s(i);else if(a.frontmatter(r))e+=`---${r.value}---
`;else if(a.comment(r))e+=`<!--${r.value}-->`;else if(a.expression(r)){e+="{";for(let i of r.children)s(i);e+="}"}else if(a.literal(r))e+=r.value;else if(a.tag(r))if(e+=`<${r.name}`,e+=c(r),r.children.length===0&&t.selfClose)e+=" />";else{e+=">";for(let i of r.children)s(i);e+=`</${r.name}>`}}return s(o),e}export{a as is,f as serialize,N as walk,u as walkAsync};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,37 @@
declare class Go {
importObject: {
gojs: {
'runtime.wasmExit': (sp: any) => void;
'runtime.wasmWrite': (sp: any) => void;
'runtime.resetMemoryDataView': (sp: any) => void;
'runtime.nanotime1': (sp: any) => void;
'runtime.walltime': (sp: any) => void;
'runtime.scheduleTimeoutEvent': (sp: any) => void;
'runtime.clearTimeoutEvent': (sp: any) => void;
'runtime.getRandomData': (sp: any) => void;
'syscall/js.finalizeRef': (sp: any) => void;
'syscall/js.stringVal': (sp: any) => void;
'syscall/js.valueGet': (sp: any) => void;
'syscall/js.valueSet': (sp: any) => void;
'syscall/js.valueDelete': (sp: any) => void;
'syscall/js.valueIndex': (sp: any) => void;
'syscall/js.valueSetIndex': (sp: any) => void;
'syscall/js.valueCall': (sp: any) => void;
'syscall/js.valueInvoke': (sp: any) => void;
'syscall/js.valueNew': (sp: any) => void;
'syscall/js.valueLength': (sp: any) => void;
'syscall/js.valuePrepareString': (sp: any) => void;
'syscall/js.valueLoadString': (sp: any) => void;
'syscall/js.valueInstanceOf': (sp: any) => void;
'syscall/js.copyBytesToGo': (sp: any) => void;
'syscall/js.copyBytesToJS': (sp: any) => void;
debug: (value: any) => void;
};
};
constructor();
run(instance: any): Promise<void>;
private _resume;
private _makeFuncWrapper;
}
export { Go as default };

View File

@@ -0,0 +1 @@
import{a}from"../chunk-W5DTLHV4.js";export{a as default};

View File

@@ -0,0 +1 @@
"use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var p=(t,e,d,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i(e))!N.call(t,o)&&o!==d&&r(t,o,{get:()=>e[o],enumerable:!(n=a(e,o))||n.enumerable});return t};var s=t=>p(r({},"__esModule",{value:!0}),t);var m={};module.exports=s(m);

View File

@@ -0,0 +1,74 @@
type ParentNode = RootNode | ElementNode | ComponentNode | CustomElementNode | FragmentNode | ExpressionNode;
type LiteralNode = TextNode | DoctypeNode | CommentNode | FrontmatterNode;
type Node = RootNode | ElementNode | ComponentNode | CustomElementNode | FragmentNode | ExpressionNode | TextNode | FrontmatterNode | DoctypeNode | CommentNode;
interface Position {
start: Point;
end?: Point;
}
interface Point {
/** 1-based line number */
line: number;
/** 1-based column number, per-line */
column: number;
/** 0-based byte offset */
offset: number;
}
interface BaseNode {
type: string;
position?: Position;
}
interface ParentLikeNode extends BaseNode {
type: 'element' | 'component' | 'custom-element' | 'fragment' | 'expression' | 'root';
children: Node[];
}
interface ValueNode extends BaseNode {
value: string;
}
interface RootNode extends ParentLikeNode {
type: 'root';
}
interface AttributeNode extends BaseNode {
type: 'attribute';
kind: 'quoted' | 'empty' | 'expression' | 'spread' | 'shorthand' | 'template-literal';
name: string;
value: string;
raw?: string;
}
interface TextNode extends ValueNode {
type: 'text';
}
interface ElementNode extends ParentLikeNode {
type: 'element';
name: string;
attributes: AttributeNode[];
}
interface FragmentNode extends ParentLikeNode {
type: 'fragment';
name: string;
attributes: AttributeNode[];
}
interface ComponentNode extends ParentLikeNode {
type: 'component';
name: string;
attributes: AttributeNode[];
}
interface CustomElementNode extends ParentLikeNode {
type: 'custom-element';
name: string;
attributes: AttributeNode[];
}
type TagLikeNode = ElementNode | FragmentNode | ComponentNode | CustomElementNode;
interface DoctypeNode extends ValueNode {
type: 'doctype';
}
interface CommentNode extends ValueNode {
type: 'comment';
}
interface FrontmatterNode extends ValueNode {
type: 'frontmatter';
}
interface ExpressionNode extends ParentLikeNode {
type: 'expression';
}
export { AttributeNode, BaseNode, CommentNode, ComponentNode, CustomElementNode, DoctypeNode, ElementNode, ExpressionNode, FragmentNode, FrontmatterNode, LiteralNode, Node, ParentLikeNode, ParentNode, Point, Position, RootNode, TagLikeNode, TextNode, ValueNode };

View File

View File

@@ -0,0 +1 @@
"use strict";var I=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var U=(E,N)=>{for(var _ in N)I(E,_,{get:N[_],enumerable:!0})},H=(E,N,_,A)=>{if(N&&typeof N=="object"||typeof N=="function")for(let T of G(N))!S.call(E,T)&&T!==_&&I(E,T,{get:()=>N[T],enumerable:!(A=M(N,T))||A.enumerable});return E};var W=E=>H(I({},"__esModule",{value:!0}),E);var P={};U(P,{DiagnosticCode:()=>O});module.exports=W(P);var O=(R=>(R[R.ERROR=1e3]="ERROR",R[R.ERROR_UNTERMINATED_JS_COMMENT=1001]="ERROR_UNTERMINATED_JS_COMMENT",R[R.ERROR_FRAGMENT_SHORTHAND_ATTRS=1002]="ERROR_FRAGMENT_SHORTHAND_ATTRS",R[R.ERROR_UNMATCHED_IMPORT=1003]="ERROR_UNMATCHED_IMPORT",R[R.ERROR_UNSUPPORTED_SLOT_ATTRIBUTE=1004]="ERROR_UNSUPPORTED_SLOT_ATTRIBUTE",R[R.WARNING=2e3]="WARNING",R[R.WARNING_UNTERMINATED_HTML_COMMENT=2001]="WARNING_UNTERMINATED_HTML_COMMENT",R[R.WARNING_UNCLOSED_HTML_TAG=2002]="WARNING_UNCLOSED_HTML_TAG",R[R.WARNING_DEPRECATED_DIRECTIVE=2003]="WARNING_DEPRECATED_DIRECTIVE",R[R.WARNING_IGNORED_DIRECTIVE=2004]="WARNING_IGNORED_DIRECTIVE",R[R.WARNING_UNSUPPORTED_EXPRESSION=2005]="WARNING_UNSUPPORTED_EXPRESSION",R[R.WARNING_SET_WITH_CHILDREN=2006]="WARNING_SET_WITH_CHILDREN",R[R.INFO=3e3]="INFO",R[R.HINT=4e3]="HINT",R))(O||{});0&&(module.exports={DiagnosticCode});

View File

@@ -0,0 +1,18 @@
declare enum DiagnosticCode {
ERROR = 1000,
ERROR_UNTERMINATED_JS_COMMENT = 1001,
ERROR_FRAGMENT_SHORTHAND_ATTRS = 1002,
ERROR_UNMATCHED_IMPORT = 1003,
ERROR_UNSUPPORTED_SLOT_ATTRIBUTE = 1004,
WARNING = 2000,
WARNING_UNTERMINATED_HTML_COMMENT = 2001,
WARNING_UNCLOSED_HTML_TAG = 2002,
WARNING_DEPRECATED_DIRECTIVE = 2003,
WARNING_IGNORED_DIRECTIVE = 2004,
WARNING_UNSUPPORTED_EXPRESSION = 2005,
WARNING_SET_WITH_CHILDREN = 2006,
INFO = 3000,
HINT = 4000
}
export { DiagnosticCode };

View File

@@ -0,0 +1 @@
var N=(R=>(R[R.ERROR=1e3]="ERROR",R[R.ERROR_UNTERMINATED_JS_COMMENT=1001]="ERROR_UNTERMINATED_JS_COMMENT",R[R.ERROR_FRAGMENT_SHORTHAND_ATTRS=1002]="ERROR_FRAGMENT_SHORTHAND_ATTRS",R[R.ERROR_UNMATCHED_IMPORT=1003]="ERROR_UNMATCHED_IMPORT",R[R.ERROR_UNSUPPORTED_SLOT_ATTRIBUTE=1004]="ERROR_UNSUPPORTED_SLOT_ATTRIBUTE",R[R.WARNING=2e3]="WARNING",R[R.WARNING_UNTERMINATED_HTML_COMMENT=2001]="WARNING_UNTERMINATED_HTML_COMMENT",R[R.WARNING_UNCLOSED_HTML_TAG=2002]="WARNING_UNCLOSED_HTML_TAG",R[R.WARNING_DEPRECATED_DIRECTIVE=2003]="WARNING_DEPRECATED_DIRECTIVE",R[R.WARNING_IGNORED_DIRECTIVE=2004]="WARNING_IGNORED_DIRECTIVE",R[R.WARNING_UNSUPPORTED_EXPRESSION=2005]="WARNING_UNSUPPORTED_EXPRESSION",R[R.WARNING_SET_WITH_CHILDREN=2006]="WARNING_SET_WITH_CHILDREN",R[R.INFO=3e3]="INFO",R[R.HINT=4e3]="HINT",R))(N||{});export{N as DiagnosticCode};

View File

@@ -0,0 +1 @@
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,t)=>{for(var n in t)o(r,n,{get:t[n],enumerable:!0})},g=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of p(t))!c.call(r,e)&&e!==n&&o(r,e,{get:()=>t[e],enumerable:!(s=a(t,e))||s.enumerable});return r};var d=r=>g(o({},"__esModule",{value:!0}),r);var m={};l(m,{DiagnosticSeverity:()=>i});module.exports=d(m);var i=(e=>(e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Information=3]="Information",e[e.Hint=4]="Hint",e))(i||{});0&&(module.exports={DiagnosticSeverity});

View File

@@ -0,0 +1,160 @@
import { RootNode } from './ast.js';
export { AttributeNode, BaseNode, CommentNode, ComponentNode, CustomElementNode, DoctypeNode, ElementNode, ExpressionNode, FragmentNode, FrontmatterNode, LiteralNode, Node, ParentLikeNode, ParentNode, Point, Position, TagLikeNode, TextNode, ValueNode } from './ast.js';
import { DiagnosticCode } from './diagnostics.js';
interface PreprocessorResult {
code: string;
map?: string;
}
interface PreprocessorError {
error: string;
}
interface ParseOptions {
position?: boolean;
}
declare enum DiagnosticSeverity {
Error = 1,
Warning = 2,
Information = 3,
Hint = 4
}
interface DiagnosticMessage {
severity: DiagnosticSeverity;
code: DiagnosticCode;
location: DiagnosticLocation;
hint?: string;
text: string;
}
interface DiagnosticLocation {
file: string;
line: number;
column: number;
length: number;
}
interface TransformOptions {
internalURL?: string;
filename?: string;
normalizedFilename?: string;
sourcemap?: boolean | 'inline' | 'external' | 'both';
astroGlobalArgs?: string;
compact?: boolean;
resultScopedSlot?: boolean;
scopedStyleStrategy?: 'where' | 'class' | 'attribute';
/**
* @deprecated "as" has been removed and no longer has any effect!
*/
as?: 'document' | 'fragment';
transitionsAnimationURL?: string;
resolvePath?: (specifier: string) => Promise<string> | string;
preprocessStyle?: (content: string, attrs: Record<string, string>) => null | Promise<PreprocessorResult | PreprocessorError>;
annotateSourceFile?: boolean;
/**
* Render script tags to be processed (e.g. script tags that have no attributes or only a `src` attribute)
* using a `renderScript` function from `internalURL`, instead of stripping the script entirely.
* @experimental
*/
renderScript?: boolean;
experimentalScriptOrder?: boolean;
}
type ConvertToTSXOptions = Pick<TransformOptions, 'filename' | 'normalizedFilename' | 'sourcemap'> & {
/** If set to true, script tags content will be included in the generated TSX
* Scripts will be wrapped in an arrow function to be compatible with JSX's spec
*/
includeScripts?: boolean;
/** If set to true, style tags content will be included in the generated TSX
* Styles will be wrapped in a template literal to be compatible with JSX's spec
*/
includeStyles?: boolean;
};
type HoistedScript = {
type: string;
} & ({
type: 'external';
src: string;
} | {
type: 'inline';
code: string;
map: string;
});
interface HydratedComponent {
exportName: string;
localName: string;
specifier: string;
resolvedPath: string;
}
interface TransformResult {
code: string;
map: string;
scope: string;
styleError: string[];
diagnostics: DiagnosticMessage[];
css: string[];
scripts: HoistedScript[];
hydratedComponents: HydratedComponent[];
clientOnlyComponents: HydratedComponent[];
serverComponents: HydratedComponent[];
containsHead: boolean;
propagation: boolean;
}
interface SourceMap {
file: string;
mappings: string;
names: string[];
sources: string[];
sourcesContent: string[];
version: number;
}
/**
* Represents a location in a TSX file.
* Both the `start` and `end` properties are 0-based, and are based off utf-16 code units. (i.e. JavaScript's `String.prototype.length`)
*/
interface TSXLocation {
start: number;
end: number;
}
interface TSXExtractedTag {
position: TSXLocation;
content: string;
}
interface TSXExtractedScript extends TSXExtractedTag {
type: 'processed-module' | 'module' | 'inline' | 'event-attribute' | 'json' | 'raw' | 'unknown';
}
interface TSXExtractedStyle extends TSXExtractedTag {
type: 'tag' | 'style-attribute';
lang: 'css' | 'scss' | 'sass' | 'less' | 'stylus' | 'styl' | 'postcss' | 'pcss' | 'unknown' | (string & {});
}
interface TSXResult {
code: string;
map: SourceMap;
diagnostics: DiagnosticMessage[];
metaRanges: {
frontmatter: TSXLocation;
body: TSXLocation;
scripts?: TSXExtractedScript[];
styles?: TSXExtractedStyle[];
};
}
interface ParseResult {
ast: RootNode;
diagnostics: DiagnosticMessage[];
}
declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
declare function parse(input: string, options?: ParseOptions): Promise<ParseResult>;
declare function convertToTSX(input: string, options?: ConvertToTSXOptions): Promise<TSXResult>;
declare function initialize(options: InitializeOptions): Promise<void>;
/**
* When calling the core compiler APIs, e.g. `transform`, `parse`, etc, they
* would automatically instantiate a WASM instance to process the input. When
* done, you can call this to manually teardown the WASM instance.
*
* If the APIs are called again, they will automatically instantiate a new WASM
* instance. In browsers, you have to call `initialize()` again before using the APIs.
*
* Note: Calling teardown is optional and exists mostly as an optimization only.
*/
declare function teardown(): void;
interface InitializeOptions {
wasmURL?: string;
}
export { ConvertToTSXOptions, DiagnosticLocation, DiagnosticMessage, DiagnosticSeverity, HoistedScript, HydratedComponent, InitializeOptions, ParseOptions, ParseResult, PreprocessorError, PreprocessorResult, RootNode, SourceMap, TSXExtractedScript, TSXExtractedStyle, TSXExtractedTag, TSXLocation, TSXResult, TransformOptions, TransformResult, convertToTSX, initialize, parse, teardown, transform };

View File

@@ -0,0 +1 @@
var t=(e=>(e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Information=3]="Information",e[e.Hint=4]="Hint",e))(t||{});export{t as DiagnosticSeverity};

Some files were not shown because too many files have changed in this diff Show More