Skip to content

Commit

Permalink
Merge pull request #718 from madeindjs/fix-custom-element
Browse files Browse the repository at this point in the history
fix(ui): avoid bundling `injectionKeys` in custom components
  • Loading branch information
ramedina86 authored Jan 7, 2025
2 parents 7b34e51 + d6fb5ec commit a50852c
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/ui/src/builder/BuilderApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
import { computed, defineAsyncComponent, inject, onMounted } from "vue";
import { useDragDropComponent } from "./useDragDropComponent";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import { isPlatformMac } from "../core/detectPlatform";
import injectionKeys from "@/injectionKeys";
import { isPlatformMac } from "@/core/detectPlatform";
import BuilderHeader from "./BuilderHeader.vue";
import BuilderTooltip from "./BuilderTooltip.vue";
import BuilderAsyncLoader from "./BuilderAsyncLoader.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import { Ref, computed, inject, ref } from "vue";
import BuilderSwitcher from "./BuilderSwitcher.vue";
import { useComponentActions } from "./useComponentActions";
import BuilderModal, { ModalAction } from "./BuilderModal.vue";
import injectionKeys from "../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderStateExplorer from "./BuilderStateExplorer.vue";
const syncHealthIcon = ref(null);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<script setup lang="ts">
import { computed, inject, Ref, ref } from "vue";
import injectionKeys from "../injectionKeys";
import injectionKeys from "@/injectionKeys";
const wf = inject(injectionKeys.core);
const ssbm = inject(injectionKeys.builderManager);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderFieldsColor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
} from "vue";
import { Component } from "@/writerTypes";
import { useComponentActions } from "../useComponentActions";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
import WdsTabs from "@/wds/WdsTabs.vue";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderFieldsKeyValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import {
toRefs,
watch,
} from "vue";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import { useEvaluator } from "@/renderer/useEvaluator";
import type { InstancePath } from "@/writerTypes";
import BuilderFieldsObject from "./BuilderFieldsObject.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderFieldsShadow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ import {
} from "vue";
import { Component } from "@/writerTypes";
import { useComponentActions } from "../useComponentActions";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
import WdsTabs from "@/wds/WdsTabs.vue";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderFieldsText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import { toRefs, inject, computed } from "vue";
import { Component, FieldControl } from "@/writerTypes";
import { useComponentActions } from "../useComponentActions";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
const wf = inject(injectionKeys.core);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderFieldsWidth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
} from "vue";
import { Component } from "@/writerTypes";
import { useComponentActions } from "../useComponentActions";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderSelect from "../BuilderSelect.vue";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
import WdsTextInput from "@/wds/WdsTextInput.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<script setup lang="ts">
import { inject, computed, ref, watch } from "vue";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderSettingsActions from "./BuilderSettingsActions.vue";
import BuilderSettingsMain from "./BuilderSettingsMain.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderSettingsAPICode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<script setup lang="ts">
import { computed, inject, ref } from "vue";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderModal, { ModalAction } from "../BuilderModal.vue";
import BuilderEmbeddedCodeEditor from "../BuilderEmbeddedCodeEditor.vue";
import WdsButton from "@/wds/WdsButton.vue";
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/builder/settings/BuilderSettingsActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
import { computed, inject, onMounted, Ref, ref, watch } from "vue";
import { useComponentActions } from "../useComponentActions";
import { WriterComponentDefinition } from "@/writerTypes";
import injectionKeys from "../../injectionKeys";
import { getModifierKeyName } from "../../core/detectPlatform";
import injectionKeys from "@/injectionKeys";
import { getModifierKeyName } from "@/core/detectPlatform";
import WdsButton from "@/wds/WdsButton.vue";
import BuilderModal, { ModalAction } from "../BuilderModal.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderSettingsBinding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<script setup lang="ts">
import { computed, inject } from "vue";
import { useComponentActions } from "../useComponentActions";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
import WdsFieldWrapper from "@/wds/WdsFieldWrapper.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderSettingsMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<script setup lang="ts">
import { inject, computed, watch, defineAsyncComponent } from "vue";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderSettingsProperties from "./BuilderSettingsProperties.vue";
import BuilderSettingsBinding from "./BuilderSettingsBinding.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderSettingsProperties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

<script setup lang="ts">
import { computed, inject } from "vue";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import { parseInstancePathString } from "@/renderer/instancePath";
import { FieldCategory, FieldType, InstancePath } from "@/writerTypes";
import BuilderFieldsAlign from "./BuilderFieldsAlign.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderSettingsVisibility.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<script setup lang="ts">
import { computed, inject } from "vue";
import { useComponentActions } from "../useComponentActions";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
import WdsFieldWrapper from "@/wds/WdsFieldWrapper.vue";
import BuilderSectionTitle from "./BuilderSectionTitle.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/settings/BuilderTemplateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<script setup lang="ts">
import Fuse from "fuse.js";
import injectionKeys from "../../injectionKeys";
import injectionKeys from "@/injectionKeys";
import {
PropType,
inject,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/renderer/ComponentProxy.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { PropType, VNode, computed, h, inject, provide, ref, watch } from "vue";
import { getTemplate } from "../core/templateMap";
import injectionKeys from "../injectionKeys";
import { getTemplate } from "@/core/templateMap";
import injectionKeys from "@/injectionKeys";
import { Component, InstancePath, InstancePathItem } from "@/writerTypes";
import ChildlessPlaceholder from "./ChildlessPlaceholder.vue";
import ComponentProxy from "./ComponentProxy.vue";
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/renderer/RendererNotifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

<script setup lang="ts">
import { inject, onMounted, reactive, Ref, ref } from "vue";
import injectionKeys from "../injectionKeys";
import WdsButton from "../wds/WdsButton.vue";
import injectionKeys from "@/injectionKeys";
import WdsButton from "@/wds/WdsButton.vue";
const MAX_ITEMS_IN_LIST = 100;
const wf = inject(injectionKeys.core);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/vite.config.custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineConfig({
},
},
rollupOptions: {
external: ["vue", "../injectionKeys"],
external: ["vue", "@/injectionKeys"],
output: {
globals: {
vue: "vue",
Expand Down

0 comments on commit a50852c

Please sign in to comment.