Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting latest changes from Framework into my fork #5

Merged
merged 38 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ee9e6c0
feat: Feature flags
ramedina86 Aug 23, 2024
5d55479
fix: Type
ramedina86 Aug 23, 2024
0ae795a
Update src/ui/src/core/index.ts
ramedina86 Aug 23, 2024
dda21c3
Update src/ui/src/core/index.ts
ramedina86 Aug 23, 2024
a1d7c50
chore: Changes to support Alex's suggestions
ramedina86 Aug 23, 2024
35bd4a9
fix: Remove test code
ramedina86 Aug 23, 2024
249db8d
fix: getting the BaseControlBar import to AnnotatedText component
Aug 26, 2024
91eeda2
Merge pull request #534 from polymorpheuz/dev
ramedina86 Aug 26, 2024
70e6d04
Merge pull request #533 from writer/feat-feature-flags
ramedina86 Aug 26, 2024
4836c36
feat: Abstract components
ramedina86 Aug 26, 2024
0656468
Merge branch 'dev' into feat-abstract-components
ramedina86 Aug 26, 2024
14735cd
fix: Test
ramedina86 Aug 26, 2024
d3416ce
fix: Missing commas
ramedina86 Aug 26, 2024
18dbad9
fix: Tests
ramedina86 Aug 26, 2024
26165f5
fix: Remove test code
ramedina86 Aug 26, 2024
c37823b
fix: Linter
ramedina86 Aug 26, 2024
755b1c1
fix: custom stylesheet and js are not loaded after OIDC authentication
FabienArcellier Aug 26, 2024
4ba4370
fix: custom stylesheet and js are not loaded after OIDC authentication
FabienArcellier Aug 27, 2024
bc8d8b7
Merge pull request #539 from writer/feat-abstract-components
ramedina86 Aug 27, 2024
9e87510
Merge pull request #536 from FabienArcellier/535-custom-stylesheet-an…
ramedina86 Aug 27, 2024
0b89a08
fix: add opportunity to customize unauthorization and callback actions
yanomaly Aug 27, 2024
1716b1f
chore: Version bump
ramedina86 Aug 27, 2024
4e57790
fix: Generate datalist id correctly
ramedina86 Aug 27, 2024
fe7d9c3
feat: Added support for button color
ramedina86 Aug 27, 2024
5b7f1d8
chore: Version bump
ramedina86 Aug 27, 2024
d60812c
Merge pull request #542 from writer/fix-minor-annotated
ramedina86 Aug 27, 2024
9d3783d
Merge pull request #540 from yanomaly/fix/custom-unauth-actions
ramedina86 Aug 27, 2024
367e0ee
chore: Toolkit refactor
ramedina86 Aug 29, 2024
8bec343
chore: Support for at symbol in editor
ramedina86 Aug 29, 2024
ddf3b33
feat: Filtering by toolkit
ramedina86 Aug 29, 2024
5f9d8ae
chore: Feature flag workflows
ramedina86 Aug 29, 2024
704cabf
chore: Rename default toolkit for core
ramedina86 Aug 29, 2024
49a597f
chore: Rename default toolkit core
ramedina86 Aug 29, 2024
693d03a
chore: Simplify path
ramedina86 Aug 29, 2024
8ea9f16
fix: Ignore image for non-core components
ramedina86 Aug 29, 2024
ab75d95
fix: Only run test for core toolkit
ramedina86 Aug 29, 2024
d102113
chore: Only apply test to core toolkit
ramedina86 Aug 29, 2024
45c0ba9
Merge pull request #545 from writer/feat-component-toolkit
ramedina86 Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 50 additions & 43 deletions docs/framework/custom-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
title: "Custom components"
---

It's possible to extend Framework with custom component templates.
It's possible to extend Framework with custom component templates.

They're developed using Vue 3 and TypeScript. Once transpiled, they can be used by copying them to the `extensions/` folder of any project.

<Note>
Custom components behave exactly like built-in ones.
They are just as performant, can contain other components, and offer the same the Builder experience. They only differ from built-in components in the way that they're bundled and imported.
<Note>
Custom components behave exactly like built-in ones. They are just as
performant, can contain other components, and offer the same the Builder
experience. They only differ from built-in components in the way that they're
bundled and imported.
</Note>

## Architecture
Expand All @@ -21,7 +23,7 @@ Extensions and custom templates are currently synonyms, but this might change in

![Custom Components - Architecture](/framework/images/custom-components.architecture.png)

Dependencies are [provided](https://vuejs.org/api/composition-api-dependency-injection.html) using injection symbols and can be _injected_ to be used by the component template. These include `evaluatedFields`, which contain the current values of the editable fields. Injected dependencies are fully typed, making development easier.
Dependencies are [provided](https://vuejs.org/api/composition-api-dependency-injection.html) using injection symbols and can be _injected_ to be used by the component template. These include `evaluatedFields`, which contain the current values of the editable fields. Injected dependencies are fully typed, making development easier.

[Rollup's external feature](https://rollupjs.org/configuration-options/#external), invoked via Vite, allows for extensions to be compiled without dependencies and link those during runtime. Therefore, extensions aren't bundled to be standalone, but rather to work as a piece of a puzzle.

Expand All @@ -35,7 +37,7 @@ Framework component templates are purely front-end. They are Vue 3 templates tha

### Simple example

This example shows a template for _Bubble Message_, a simple demo component with one editable field, `text`.
This example shows a template for _Bubble Message_, a simple demo component with one editable field, `text`.

```js
<template>
Expand All @@ -44,21 +46,21 @@ This example shows a template for _Bubble Message_, a simple demo component with
<div class="message">

<!-- Shows the current value of the field "text" -->

{{ fields.text.value }}
</div>
</div>
</template>

<script lang="ts">
export default {
export default {
writer: {
name: "Bubble Message",
description: "Shows a message in the shape of a speech bubble.",
category: "Content",

// Fields will be editable via Framework Builder

fields: {
text: {
name: "Text",
Expand All @@ -73,7 +75,7 @@ export default {
};
</script>
<script setup lang="ts">
import { FieldType } from "../writerTypes";
import { FieldType } from "@/writerTypes";
import injectionKeys from "../injectionKeys";
import { inject } from "vue";

Expand All @@ -99,38 +101,43 @@ The code above will make Bubble Message available in the Builder.
### Run a local server

<Steps>
<Step title="Clone the Framework Repository">
To get started, clone the [Framework repository](https://github.com/writer/writer-framework) from GitHub.
</Step>
<Step title="Set Up the Development Environment">
To develop custom templates in a developer-friendly way, ensure you have a front-end development server with instant reload capabilities. The front-end code for Framework is located in the `ui` folder. With Node and npm installed on your system, run `npm install` to install dependencies. Then, start the server with support for custom component templates using `npm run custom.dev`.
```sh
cd ui
npm install
# "custom.dev" links templates in "custom_components/"
# "dev" runs the server without them
npm run custom.dev
```
</Step>
<Step title="Start the Back-End Server">
The command `npm run custom.dev` starts a front-end server, which requires a back-end to function fully. Start Framework via command line, specifying the option `--port 5000`, to provide a back-end on that port. It's recommended to create a new app for testing the template you're developing.
```sh
writer create customtester
writer edit customtester --port 5000
```
</Step>
<Step title="Access Framework and Test Custom Component">
You should now be able to access Framework via the URL provided by Vite, e.g. `http://localhost:5174`. In the Builder's _Toolkit_, you should see the sample component, _Balloon Message_. Add it to your tester application.
</Step>
<Step title="Clone the Framework Repository">
To get started, clone the [Framework
repository](https://github.com/writer/writer-framework) from GitHub.
</Step>
<Step title="Set Up the Development Environment">
To develop custom templates in a developer-friendly way, ensure you have a
front-end development server with instant reload capabilities. The front-end
code for Framework is located in the `ui` folder. With Node and npm
installed on your system, run `npm install` to install dependencies. Then,
start the server with support for custom component templates using `npm run
custom.dev`. ```sh cd ui npm install # "custom.dev" links templates in
"custom_components/" # "dev" runs the server without them npm run custom.dev
```
</Step>
<Step title="Start the Back-End Server">
The command `npm run custom.dev` starts a front-end server, which requires a
back-end to function fully. Start Framework via command line, specifying the
option `--port 5000`, to provide a back-end on that port. It's recommended
to create a new app for testing the template you're developing. ```sh writer
create customtester writer edit customtester --port 5000 ```
</Step>
<Step title="Access Framework and Test Custom Component">
You should now be able to access Framework via the URL provided by Vite,
e.g. `http://localhost:5174`. In the Builder's _Toolkit_, you should see the
sample component, _Balloon Message_. Add it to your tester application.
</Step>
</Steps>


### Create a new component

<Tip>
You can also have a look at the built-in component templates, since their syntax is equivalent. They can be found in the `ui/src/core_components/` folder.
You can also have a look at the built-in component templates, since their
syntax is equivalent. They can be found in the `ui/src/components/` folder.
</Tip>
Go to `ui/src/custom_components/` and open the Vue single-file components, i.e. the `.vue` files. These files contain comments that will help you get started. Try editing the provided templates, you should see changes reflected.
Go to `ui/src/custom_components/` and open the Vue single-file components, i.e. the
`.vue` files. These files contain comments that will help you get started. Try editing
the provided templates, you should see changes reflected.

You can get started by duplicating one of these examples. Make sure you add the new template to the entrypoint, as discussed below.

Expand All @@ -141,15 +148,15 @@ For custom component templates to be taken into account, they need to be accessi
```ts
// Import the templates

import BubbleMessage from './BubbleMessage.vue';
import BubbleMessageAdvanced from './BubbleMessageAdvanced.vue';
import BubbleMessage from "./BubbleMessage.vue";
import BubbleMessageAdvanced from "./BubbleMessageAdvanced.vue";

// Export an object with the ids and the templates as default

export default {
"bubblemessage": BubbleMessage,
"bubblemessageadvanced": BubbleMessageAdvanced
}
bubblemessage: BubbleMessage,
bubblemessageadvanced: BubbleMessageAdvanced,
};
```

A single or multiple templates can be specified. Take into account that they will all be exported, and later imported, together.
Expand All @@ -160,7 +167,7 @@ Execute `npm run custom.build`, this will generate the output `.js` and `.css` f

```sh
# "build" builds the entire front-end
# "custom.build" only builds the custom templates
# "custom.build" only builds the custom templates

npm run custom.build
```
Expand Down
1 change: 1 addition & 0 deletions docs/tests/componentImages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const components = require('writer-ui/components.codegen.json');

describe('Components docs', () => {
for (const component of components) {
if (component.toolkit && component.toolkit !== "core") return;
it(`${component.name} - should have an image`, () => {
expect(() => {
fs.accessSync(`./framework/public/components/${component.type}.png`);
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "writer"
version = "0.7.0"
version = "0.7.2"
description = "An open-source, Python framework for building feature-rich apps that are fully integrated with the Writer platform."
authors = ["Writer, Inc."]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ import BuilderHeader from "./BuilderHeader.vue";
import BuilderSettings from "./BuilderSettings.vue";
import BuilderEditor from "./BuilderEditor.vue";
import BuilderSidebar from "./BuilderSidebar.vue";
import ComponentRenderer from "../renderer/ComponentRenderer.vue";
import ComponentRenderer from "@/renderer/ComponentRenderer.vue";
import BuilderComponentShortcuts from "./BuilderComponentShortcuts.vue";
import injectionKeys from "../injectionKeys";
import BuilderInstanceTracker from "./BuilderInstanceTracker.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderComponentShortcuts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<script setup lang="ts">
import { computed, inject, onMounted, Ref, ref, toRefs, watch } from "vue";
import { useComponentActions } from "./useComponentActions";
import { Component, WriterComponentDefinition } from "../writerTypes";
import { Component, WriterComponentDefinition } from "@/writerTypes";
import injectionKeys from "../injectionKeys";
import { isPlatformMac } from "../core/detectPlatform";

Expand Down Expand Up @@ -212,7 +212,7 @@
function addComponent(event: Event) {
const definitionName = (event.target as HTMLInputElement).value;
const matchingTypes = Object.entries(validChildrenTypes.value).filter(
([type, definition]) => {

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'type' is defined but never used

Check warning on line 215 in src/ui/src/builder/BuilderComponentShortcuts.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'type' is defined but never used
if (definition.name == definitionName) return true;
return false;
},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderFieldsAlign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
ref,
toRefs,
} from "vue";
import { Component } from "../writerTypes";
import { Component } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderSelect from "./BuilderSelect.vue";
Expand All @@ -86,22 +86,22 @@

type Mode = "pick" | "css" | "default";

enum SubMode {

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'SubMode' is defined but never used

Check warning on line 89 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'SubMode' is defined but never used
hleft = "start",

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hleft' is defined but never used

Check warning on line 90 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hleft' is defined but never used
hcenter = "center",

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hcenter' is defined but never used

Check warning on line 91 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hcenter' is defined but never used
hright = "end",

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'hright' is defined but never used

Check warning on line 92 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'hright' is defined but never used
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
vtop = "start",

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vtop' is defined but never used

Check warning on line 94 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vtop' is defined but never used
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
vcenter = "center",

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vcenter' is defined but never used

Check warning on line 96 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vcenter' is defined but never used
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
vbottom = "end",

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'vbottom' is defined but never used

Check warning on line 98 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'vbottom' is defined but never used
}

type SubModes = {
key: SubMode;
label: string;
match: (v: string) => boolean;

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.12)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.10)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.11)

'v' is defined but never used

Check warning on line 104 in src/ui/src/builder/BuilderFieldsAlign.vue

View workflow job for this annotation

GitHub Actions / build (3.9)

'v' is defined but never used
default: string;
icon?: string;
}[];
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderFieldsColor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {
ref,
toRefs,
} from "vue";
import { Component } from "../writerTypes";
import { Component } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/builder/BuilderFieldsKeyValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ import {
watch,
} from "vue";
import injectionKeys from "../injectionKeys";
import { useEvaluator } from "../renderer/useEvaluator";
import type { InstancePath } from "../writerTypes";
import { useEvaluator } from "@/renderer/useEvaluator";
import type { InstancePath } from "@/writerTypes";
import BuilderFieldsObject from "./BuilderFieldsObject.vue";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
import { useComponentActions } from "./useComponentActions";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderFieldsObject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<script setup lang="ts">
import { toRefs, inject, computed } from "vue";
import { Component } from "../writerTypes";
import { Component } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderFieldsPadding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ import {
ref,
toRefs,
} from "vue";
import { Component } from "../writerTypes";
import { Component } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderSelect from "./BuilderSelect.vue";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderFieldsShadow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ import {
ref,
toRefs,
} from "vue";
import { Component } from "../writerTypes";
import { Component } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
Expand Down
8 changes: 6 additions & 2 deletions src/ui/src/builder/BuilderFieldsText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
>
<BuilderTemplateInput
class="content"
:input-id="inputId"
:value="component.content[fieldKey]"
:placeholder="templateField?.default"
:options="options"
Expand All @@ -19,6 +20,7 @@
multiline
variant="text"
class="content"
:input-id="inputId"
:value="component.content[fieldKey]"
:placeholder="templateField?.default"
@input="handleInput"
Expand All @@ -29,7 +31,7 @@

<script setup lang="ts">
import { toRefs, inject, computed } from "vue";
import { Component, FieldControl } from "../writerTypes";
import { Component, FieldControl } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderTemplateInput from "./BuilderTemplateInput.vue";
Expand All @@ -50,14 +52,16 @@ const templateField = computed(() => {
return definition.fields[fieldKey.value];
});

const inputId = computed(() => `${props.componentId}-${props.fieldKey}`);

const options = computed(() => {
const field = templateField.value;
if (field.options) {
return typeof field.options === "function"
? field.options(wf, componentId.value)
: field.options;
}
return [];
return {};
});

const handleInput = (ev: Event) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderFieldsWidth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import {
ref,
toRefs,
} from "vue";
import { Component } from "../writerTypes";
import { Component } from "@/writerTypes";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderSelect from "./BuilderSelect.vue";
Expand Down
19 changes: 15 additions & 4 deletions src/ui/src/builder/BuilderHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,27 @@ const animate = () => {
};

const syncHealthStatus = () => {
let s = "";
switch (wf.syncHealth.value) {
case "offline":
return "Offline. Not syncing.";
s += "Offline. Not syncing.";
break;
case "connected":
return "Online. Syncing...";
s += "Online. Syncing...";
break;
case "idle":
return "Sync not initialised.";
s += "Sync not initialised.";
break;
case "suspended":
return "Sync suspended.";
s += "Sync suspended.";
break;
}

if (wf.featureFlags.value.length > 0) {
s += ` Feature flags: ${wf.featureFlags.value.join(", ")}`;
}

return s;
};

function showStateExplorer() {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderSettingsHandlers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ import { computed, ComputedRef, inject, Ref, ref } from "vue";
import { useComponentActions } from "./useComponentActions";
import injectionKeys from "../injectionKeys";
import BuilderModal, { ModalAction } from "./BuilderModal.vue";
import { WriterComponentDefinition } from "../writerTypes";
import { WriterComponentDefinition } from "@/writerTypes";

const wf = inject(injectionKeys.core);
const ssbm = inject(injectionKeys.builderManager);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/builder/BuilderSettingsProperties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
<script setup lang="ts">
import { computed, inject } from "vue";
import injectionKeys from "../injectionKeys";
import { parseInstancePathString } from "../renderer/instancePath";
import { FieldCategory, FieldType, InstancePath } from "../writerTypes";
import { parseInstancePathString } from "@/renderer/instancePath";
import { FieldCategory, FieldType, InstancePath } from "@/writerTypes";
import BuilderFieldsAlign from "./BuilderFieldsAlign.vue";
import BuilderFieldsColor from "./BuilderFieldsColor.vue";
import BuilderFieldsKeyValue from "./BuilderFieldsKeyValue.vue";
Expand Down
Loading