Explorar el Código

feat: add documentation

Ahmad Kholid hace 3 años
padre
commit
4bb86a61b6

+ 1 - 1
src/components/newtab/app/AppSidebar.vue

@@ -77,7 +77,7 @@ const links = [
   {
     name: t('common.docs', 2),
     icon: 'riBookOpenLine',
-    url: 'https://github.com/kholid060/automa/wiki',
+    url: 'https://docs.automa.site',
   },
   {
     name: 'GitHub',

+ 5 - 6
src/components/newtab/workflow/WorkflowDetailsCard.vue

@@ -74,20 +74,19 @@
             )
           "
           draggable="true"
-          class="transform select-none cursor-move relative p-4 rounded-lg bg-input transition"
+          class="transform select-none cursor-move relative p-4 rounded-lg bg-input transition group"
           @dragstart="
             $event.dataTransfer.setData('block', JSON.stringify(block))
           "
         >
           <a
-            v-if="block.docs"
-            :href="`https://github.com/Kholid060/automa/wiki/Blocks#${block.id}`"
-            target="_blank"
+            :href="`https://docs.automa.site/blocks/${block.id}.html`"
             :title="t('common.docs')"
+            target="_blank"
             rel="noopener"
-            class="absolute top-px right-2"
+            class="absolute top-px right-2 top-2 text-gray-600 invisible group-hover:visible"
           >
-            &#128712;
+            <v-remixicon name="riInformationLine" size="18" />
           </a>
           <v-remixicon :name="block.icon" size="24" class="mb-2" />
           <p class="leading-tight text-overflow">

+ 13 - 3
src/components/newtab/workflow/WorkflowEditBlock.vue

@@ -1,12 +1,22 @@
 <template>
   <div class="px-4 overflow-auto scroll pb-1">
-    <div class="sticky top-0 z-20 bg-white border-b border-gray-100 pb-4 mb-4">
-      <button class="mr-2 align-middle" @click="$emit('close')">
+    <div
+      class="sticky top-0 z-20 bg-white border-b border-gray-100 pb-4 mb-4 flex items-center"
+    >
+      <button class="mr-2" @click="$emit('close')">
         <v-remixicon name="riArrowLeftLine" />
       </button>
-      <p class="font-semibold inline-block align-middle">
+      <p class="font-semibold inline-block flex-1">
         {{ t(`workflow.blocks.${data.id}.name`) }}
       </p>
+      <a
+        :title="t('common.docs')"
+        :href="`https://docs.automa.site/blocks/${data.id}.html`"
+        rel="noopener"
+        target="_blank"
+      >
+        <v-remixicon name="riInformationLine" />
+      </a>
     </div>
     <component
       :is="data.editComponent"

+ 1 - 1
src/components/newtab/workflow/WorkflowGlobalData.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="global-data">
     <a
-      href="https://github.com/Kholid060/automa/wiki/Features#reference-data"
+      href="https://docs.automa.site/api-reference/reference-data.html"
       target="_blank"
       rel="noopener"
       class="inline-block text-primary"

+ 2 - 2
src/components/newtab/workflow/edit/EditGoogleSheets.vue

@@ -27,7 +27,7 @@
       <template #label>
         {{ t('workflow.blocks.google-sheets.spreadsheetId.label') }}
         <a
-          href="https://github.com/Kholid060/automa/wiki/Blocks#spreadsheet-id"
+          href="https://docs.automa.site/blocks/google-sheets.html#spreadsheet-id"
           target="_blank"
           rel="noopener"
           :title="t('workflow.blocks.google-sheets.spreadsheetId.link')"
@@ -45,7 +45,7 @@
       <template #label>
         {{ t('workflow.blocks.google-sheets.range.label') }}
         <a
-          href="https://github.com/Kholid060/automa/wiki/Blocks#range"
+          href="https://docs.automa.site/blocks/google-sheets.html#range"
           target="_blank"
           rel="noopener"
           :title="t('workflow.blocks.google-sheets.range.link')"

+ 5 - 5
src/components/newtab/workflow/edit/EditJavascriptCode.vue

@@ -51,7 +51,7 @@
             <a
               v-for="func in availableFuncs"
               :key="func.id"
-              :href="`https://github.com/Kholid060/automa/wiki/Blocks#${func.id}`"
+              :href="`https://docs.automa.site/blocks/javascript-code.html#${func.id}`"
               target="_blank"
               rel="noopener"
               class="inline-block"
@@ -108,8 +108,8 @@ const emit = defineEmits(['update:data']);
 const { t } = useI18n();
 
 const availableFuncs = [
-  { name: 'automaNextBlock(data)', id: 'automanextblockdata' },
-  { name: 'automaRefData(keyword, path)', id: 'automarefdatakeyword-path' },
+  { name: 'automaNextBlock(data)', id: 'automanextblock-data' },
+  { name: 'automaRefData(keyword, path)', id: 'automarefdata-keyword-path' },
   { name: 'automaResetTimeout', id: 'automaresettimeout' },
 ];
 
@@ -159,7 +159,7 @@ function automaFuncsCompletion(context) {
             <code>automaNextBlock(<i>data</i>)</code>
             <p class="mt-2">
               Execute the next block
-              <a href="https://github.com/Kholid060/automa/wiki/Blocks#automanextblockdata" target="_blank" class="underline">
+              <a href="https://docs.automa.site/blocks/javascript-code.html#automanextblock-data" target="_blank" class="underline">
                 Read more
               </a>
             </p>
@@ -179,7 +179,7 @@ function automaFuncsCompletion(context) {
             <code>automaRefData(<i>keyword</i>, <i>path</i>)</code>
             <p class="mt-2">
               Use this function to
-              <a href="https://github.com/Kholid060/automa/wiki/Features#reference-data" target="_blank" class="underline">
+              <a href="https://docs.automa.site/api-reference/reference-data.html" target="_blank" class="underline">
                 reference data
               </a>
             </p>

+ 1 - 1
src/components/newtab/workflow/edit/EditNewTab.vue

@@ -15,7 +15,7 @@
       @change="updateData({ url: $event })"
     />
     <a
-      href="https://github.com/Kholid060/automa/wiki/Features#reference-data"
+      href="https://docs.automa.site/api-reference/reference-data.html"
       rel="noopener"
       class="text-primary inline-block text-sm"
       target="_blank"

+ 1 - 1
src/components/newtab/workflow/edit/EditWebhook.vue

@@ -95,7 +95,7 @@
       />
       <div class="mt-3">
         <a
-          href="https://github.com/Kholid060/automa/wiki/Features#reference-data"
+          href="https://docs.automa.site/api-reference/reference-data.html"
           rel="noopener"
           class="border-b text-primary"
           target="_blank"

+ 1 - 1
src/content/services/web-service.js

@@ -25,7 +25,7 @@ function initWebListener() {
 
 async function listenWindowMessage(workflows) {
   try {
-    if (secrets?.webOrigin !== window.location.origin) return;
+    if (secrets?.webOrigin.includes(window.location.origin)) return;
 
     const db = await openDB('automa', 1, {
       upgrade(event) {

+ 2 - 2
src/locales/en/blocks.json

@@ -107,8 +107,8 @@
           "link": "Click to see more example"
         },
         "select": {
-          "get": "Get spreadsheet data",
-          "update": "Update spreadsheet data"
+          "get": "Get spreadsheet cell values",
+          "update": "Update spreadsheet cell values"
         }
       },
       "active-tab": {