Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
justintaylor-dev committed Sep 29, 2024
1 parent 467c80b commit 659e4c1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 53 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "vite build",
"dev": "vite build --mode staging && concurrently \"yarn devmain\" \"yarn serve_copy\"",
"serve_copy": "ccweb-add-on-scripts start --use \"vite build --mode copy\" --src=dummy",
"serve_copy": "ccweb-add-on-scripts start --use \"vite build --mode copy\" --src=src-code",
"serve_copy_GOOD": "ccweb-add-on-scripts start --use \"vite build --mode copy\" --src=.tmp",
"serve_copy_f": "ccweb-add-on-scripts start --use \"cpy .tmp/* dist\" --src=.tmp",
"serve_dev": "ccweb-add-on-scripts start --use \"vite build --mode staging\" --src=src-code",
Expand Down
36 changes: 5 additions & 31 deletions src-code/add-on-sandbox-sdk.d.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
/********************************************************************************
* MIT License
* © Copyright 2023 Adobe. All rights reserved.
* 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.
********************************************************************************/

// DO NOT modify this file.

declare module "add-on-sdk-document-sandbox" {
import { AddOnDocumentSandboxSdkTypes } from "@adobe/ccweb-add-on-sdk-types";
export default AddOnDocumentSandboxSdkTypes.default;
export * from "@adobe/ccweb-add-on-sdk-types/sandbox/add-on-sdk-document-sandbox";
import { AddOnDocumentSandboxSdkTypes } from "@adobe/ccweb-add-on-sdk-types";
export default AddOnDocumentSandboxSdkTypes.default;
export * from "@adobe/ccweb-add-on-sdk-types/sandbox/add-on-sdk-document-sandbox";
}

declare module "express-document-sdk" {
export * from "@adobe/ccweb-add-on-sdk-types/sandbox/express-document-sdk";
}
export * from "@adobe/ccweb-add-on-sdk-types/sandbox/express-document-sdk";
}
17 changes: 11 additions & 6 deletions src-code/code.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
// import { getStore, setStore, listenTS, dispatchTS } from "./utils/code-utils";

console.log("Hello World from CODE!");
//
console.log("CODE A!");

import addOnSandboxSdk from "add-on-sdk-document-sandbox";
console.log("CODE B!");
import { editor, colorUtils } from "express-document-sdk";
console.log("CODE C!");

const { runtime } = addOnSandboxSdk.instance;
console.log("CODE D!");

async function start() {
console.log("CODE E!");
const sandboxApi = {
createShapes: function () {
addOnSandboxSdk.instance.runtime.apiProxy.console.log(
"Creating shapes 6"
);
console.log("CODE F!");
console.log("Creating shapes 6");
const insertionParent = editor.context.insertionParent;

const rectangle = editor.createRectangle();
rectangle.width = 400;
rectangle.height = 800;
rectangle.height = 400;
rectangle.translation = { x: 100, y: 20 };
const rectFill = editor.makeColorFill(
colorUtils.fromRGB(
Expand All @@ -35,7 +37,10 @@ async function start() {
};

// Expose `sandboxApi` to the UI runtime.
console.log("CODE g!");
runtime.exposeApi(sandboxApi);
console.log("CODE H!");
}

start();
console.log("CODE j!");
File renamed without changes.
File renamed without changes
16 changes: 2 additions & 14 deletions src/App.svelte → src/main.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from "svelte";
import svelteLogo from "./assets/svelte.svg";
import viteLogo from "/vite.svg";
import viteLogo from "./assets/vite.svg";
import AddOnSdk from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
let sandboxProxy: any;
Expand All @@ -27,7 +27,6 @@
sandboxProxy = await runtime.apiProxy("documentSandbox");
console.log("sandboxProxy", sandboxProxy);
});
AddOnSdk.app.document.plu;
});
</script>

Expand All @@ -41,18 +40,7 @@
</a>
</div>
<h1>Vite + Svelte</h1>
<button on:click={() => shapes()}>Do Ssdfdsftuff</button>
<button on:click={() => location.reload}>Reload</button>

<p>
Check out <a
href="https://github.com/sveltejs/kit#readme"
target="_blank"
rel="noreferrer">SvelteKitttt</a
>, the official Svelte app framework powered by Vite!
</p>

<p class="read-the-docs">Click on the Vite and Svelte logos to learn more</p>
<button on:click={() => shapes()}>Make Shapes</button>
</main>

<style>
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./app.css";
import App from "./app.svelte";
import App from "./main.svelte";

const mode = import.meta.env.MODE; // "dev" | "production" | "staging"

Expand Down

0 comments on commit 659e4c1

Please sign in to comment.