diff --git a/menu_types.ts b/menu_types.ts deleted file mode 100644 index ee92484..0000000 --- a/menu_types.ts +++ /dev/null @@ -1,388 +0,0 @@ -interface MenuItem { - class: string; - type: string; - icon: string; - name: string; - cat: string; - selector: string; - ctxmenu: boolean; - enable: boolean; - expanded: boolean; -} - -interface SubMenuItem { - class: string; - type: string; - icon: string; - name: string; - selector: string; - enable: boolean; -} - -interface CustomIcon { - name: string; - svgContent: string; -} - -interface Config { - [key: string]: { - name: string; - menuItems: MenuItem[]; - subMenuItems: { - [key: string]: SubMenuItem[]; - }; - customIcons: CustomIcon[]; - }; -} - -interface TransformedSubMenuItems extends SubMenuItem { - type: string; -} - -export const defaultConfigs: Config = { - default: { - name: "Default", - menuItems: [ - { - class: "cs-border", - type: "border", - icon: "cs-style-border", - name: "Border", - cat: "", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-bg", - type: "bg", - icon: "cs-background", - name: "Background", - cat: "", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-rotate", - type: "rotate", - icon: "rotate-cw", - name: "Rotate", - cat: "", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-shape", - type: "shape", - icon: "diamond", - name: "Shape", - cat: "", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-highlight", - type: "highlight", - icon: "star", - name: "Highlight", - cat: "", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-extra", - type: "extra", - icon: "more-horizontal", - name: "Extra", - cat: "", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-line-type", - type: "lineType", - icon: "cs-border-corner-pill", - name: "Line type", - cat: "edge", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-line-style", - type: "lineStyle", - icon: "cs-line-style", - name: "Line style", - cat: "edge", - selector: "", - ctxmenu: false, - enable: true, - }, - { - class: "cs-line-thickness", - type: "lineThickness", - icon: "equal", - name: "Line thickness", - cat: "edge", - selector: "", - ctxmenu: false, - enable: true, - }, - ], - subMenuItems: { - border: [ - { - class: "cs-border-none", - type: "border", - icon: "cs-no-border", - name: "No border", - selector: "", - enable: true, - }, - { - class: "cs-border-dashed", - type: "border", - icon: "box-select", - name: "Dashed", - selector: "", - enable: true, - }, - ], - bg: [ - { - class: "cs-bg-transparent", - type: "bg", - icon: "cs-transparent", - name: "Transparent", - selector: "", - enable: true, - }, - { - class: "cs-bg-opacity-0", - type: "bg", - icon: "cs-opacity", - name: "Opacity 0", - selector: "", - enable: true, - }, - ], - rotate: [ - { - class: "cs-rotate-right-45", - type: "rotate", - icon: "redo", - name: "Right 45", - selector: "", - enable: true, - }, - { - class: "cs-rotate-right-90", - type: "rotate", - icon: "redo", - name: "Right 90", - selector: "", - enable: true, - }, - { - class: "cs-rotate-left-45", - type: "rotate", - icon: "undo", - name: "Left 45", - selector: "", - enable: true, - }, - { - class: "cs-rotate-left-90", - type: "rotate", - icon: "undo", - name: "Left 90", - selector: "", - enable: true, - }, - ], - shape: [ - { - class: "cs-shape-circle", - type: "shape", - icon: "circle", - name: "Circle", - selector: "", - enable: true, - }, - { - class: "cs-shape-parallelogram-right", - type: "shape", - icon: "cs-parallelogram-right", - name: "Parallelogram right", - selector: "", - enable: true, - }, - { - class: "cs-shape-parallelogram-left", - type: "shape", - icon: "cs-parallelogram-left", - name: "Parallelogram left", - selector: "", - enable: true, - }, - ], - highlight: [], - extra: [], - lineType: [ - { - class: "cs-line-straight", - type: "lineType", - icon: "minus", - name: "Straight", - selector: "", - enable: true, - }, - { - class: "cs-line-elbow", - type: "lineType", - icon: "cs-elbow", - name: "Elbow", - selector: "", - enable: true, - }, - ], - lineStyle: [ - { - class: "cs-line-dashed", - type: "lineStyle", - icon: "cs-line-dashed", - name: "Dashed", - selector: "", - enable: true, - }, - { - class: "cs-line-dashed-round", - type: "lineStyle", - icon: "cs-line-dashed", - name: "Dashed round", - selector: "", - enable: true, - }, - { - class: "cs-line-dotted", - type: "lineStyle", - icon: "cs-line-dotted", - name: "Dotted", - selector: "", - enable: true, - }, - { - class: "cs-line-dotted-line", - type: "lineStyle", - icon: "cs-dotted-line", - name: "Dotted line", - selector: "", - enable: true, - }, - ], - lineThickness: [ - { - class: "cs-line-thick", - type: "lineThickness", - icon: "cs-thicker", - name: "Thicker", - selector: "", - enable: true, - }, - { - class: "cs-line-thicker", - type: "lineThickness", - icon: "cs-thicker++", - name: "Thicker++", - selector: "", - enable: true, - }, - ], - }, - customIcons: [], - }, -}; - -export const csIcons: CustomIcon[] = [ - // Lucide Icons - { - name: "cs-no-border", - svgContent: ``, - }, - { - name: "cs-thicker", - svgContent: ``, - }, - { - name: "cs-thicker++", - svgContent: ``, - }, - { - name: "cs-circle-dashed", - svgContent: ``, - }, - // Tabler Icons - { - name: "cs-background", - svgContent: ``, - }, - { - name: "cs-transparent", - svgContent: ``, - }, - { - name: "cs-opacity", - svgContent: ``, - }, - { - name: "cs-border-corner-pill", - svgContent: ``, - }, - { - name: "cs-line-style", - svgContent: ``, - }, - { - name: "cs-line-dashed", - svgContent: ``, - }, - { - name: "cs-line-dotted", - svgContent: ``, - }, - { - name: "cs-dotted-line", - svgContent: ``, - }, - { - name: "cs-input-check", - svgContent: ``, - }, - // Custom Icons - { - name: "cs-style-border", - svgContent: ``, - }, - { - name: "cs-parallelogram-right", - svgContent: ``, - }, - { - name: "cs-parallelogram-left", - svgContent: ``, - }, - { - name: "cs-elbow", - svgContent: ``, - }, - { - name: "cs-badge-cc", - svgContent: ``, - }, - //{name: "xxx", svgContent: `yyy`}, -]; diff --git a/test.ts b/test.ts deleted file mode 100644 index 1d0325d..0000000 --- a/test.ts +++ /dev/null @@ -1,125 +0,0 @@ -const data = { - object: { - id: "ch_3PFmvzCWW92SCjp31VLjkU2R", - object: "charge", - amount: 5000, - amount_captured: 5000, - amount_refunded: 0, - application: null, - application_fee: null, - application_fee_amount: null, - balance_transaction: "txn_3PFmvzCWW92SCjp31EdS32Vk", - billing_details: { - address: { - city: null, - country: "US", - line1: null, - line2: null, - postal_code: "80205", - state: null, - }, - email: "jcollingj@gmail.com", - name: "Jacob Colling", - phone: null, - }, - calculated_statement_descriptor: "JCDV, LLC", - captured: true, - created: 1715560808, - currency: "usd", - customer: null, - description: null, - destination: null, - dispute: null, - disputed: false, - failure_balance_transaction: null, - failure_code: null, - failure_message: null, - fraud_details: {}, - invoice: null, - livemode: false, - metadata: {}, - on_behalf_of: null, - order: null, - outcome: { - network_status: "approved_by_network", - reason: null, - risk_level: "normal", - risk_score: 37, - seller_message: "Payment complete.", - type: "authorized", - }, - paid: true, - payment_intent: "pi_3PFmvzCWW92SCjp3192hXxWr", - payment_method: "pm_1PFmvzCWW92SCjp37Qs9EfJC", - payment_method_details: { - card: { - amount_authorized: 5000, - brand: "visa", - checks: { - address_line1_check: null, - address_postal_code_check: "pass", - cvc_check: "pass", - }, - country: "US", - exp_month: 2, - exp_year: 2025, - extended_authorization: { - status: "disabled", - }, - fingerprint: "AnpZ9XmbeduK6HH1", - funding: "credit", - incremental_authorization: { - status: "unavailable", - }, - installments: null, - last4: "4242", - mandate: null, - multicapture: { - status: "unavailable", - }, - network: "visa", - network_token: { - used: false, - }, - overcapture: { - maximum_amount_capturable: 5000, - status: "unavailable", - }, - three_d_secure: null, - wallet: null, - }, - type: "card", - }, - radar_options: {}, - receipt_email: null, - receipt_number: null, - receipt_url: - "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTzhFajNDV1c5MlNDanAzKOrChbIGMgah7uHlyQM6LBZhmbz-SiDru5rvSmsz_W2ZNnluLhet90uQoM0O7UtwRRFqH83bSzHa-WEP", - refunded: false, - review: null, - shipping: null, - source: null, - source_transfer: null, - statement_descriptor: null, - statement_descriptor_suffix: null, - status: "succeeded", - transfer_data: null, - transfer_group: null, - }, - previous_attributes: { - balance_transaction: null, - receipt_url: - "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTzhFajNDV1c5MlNDanAzKOvChbIGMgaStMSjHZI6LBau606Kug33Cye5Ulq_l27CARuYmEj-63piE222ICd66Zp_N6FgJV7IAEe1", - }, -}; -const url = - "https://script.google.com/macros/s/AKfycbzIOC4eyZ6ttfhONhBvrZZxYMNAqCT6K4RM-qkyGaCSsQ9yF1RJIxCGysbfMVrazeVfdg/exec"; -const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(data), -}); -console.log(response); -console.log(await response.text());