Commit Graph

54 Commits

Author SHA1 Message Date
Ramon van Bezouw
df054f294d RTL support in translation interface (#14665)
* first draft for translations rtl implementation

* make direction field dybamic

* Fixed default direction field

* added directionality to: tags, input-multiline, repeater (list)

* added directionality for wysiwyg, input-autocomplete, groups

* reverted directionality in wysiwyg-editor

* removed hardcoded rtl, ltr buttons from wysiwyg toolbar

* working directionality in wysiwyg editor

* also add v-if to await language for second language (split-view) in translations.vue

* added watcher for changing wysiwyg directionality on language change

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Martijn de Voogd <devoogd@kissthefrog.nl>
Co-authored-by: Martijn <73393707+martijn-dev@users.noreply.github.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-08-09 15:23:05 +02:00
Rijk van Zanten
d6846d74eb Refactor unnecessary nested app folders (#14580)
* Remove unused nested folders from components

* Remove nested folders

* Standardize composables output

* Fix import inconsistencies

* Same trick for directives

* Same for routes

* Replace reliance root grouped export in favor of explicit imports

* Replace reliance on implicit imports

* Remove nested folder structure

* Consistent use of non-default exports in utils

* Remove nested folder structure from private components

* Fix test mock

* Remove extraneous component registration for valuenull

* Fix stores provider

* Fix logo sprite
2022-07-22 15:10:28 -04:00
ian
71e01e2ac2 Enable spellcheck on wysiwyg and markdown interfaces (#14412)
* Enable spellcheck for rich text md interface

* Enable spellcheck for rich text html interface

* Fix typings

* Disable fenced code block highlighting in markdown

* Revert syntax highlighting disabling

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-07-14 16:08:43 +00:00
ian
7b32fbbd46 Fix/wysiwyg context menu (#14404) 2022-07-12 18:32:35 +02:00
Azri Kahar
c87eb8141f Prevent empty title attribute in WYSIWYG links (#14322) 2022-07-08 14:38:08 +02:00
ian
449e87ab27 Only emit value if updated for wysiwyg interface (#14216)
* Only emit value if updated for wysiwyg interface

* Update app/src/interfaces/input-rich-text-html/input-rich-text-html.vue

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-06-30 09:51:43 -04:00
ian
e0730af281 Trigger focus event to ensure observable exists in WYSIWYG (#13829)
* Trigger focus event to ensure observable exists in WYSIWYG

* Remove unused init event
2022-06-13 11:11:43 -04:00
ian
50e1993bb8 Emit input whenever WYSIWYG content is updated (#13802)
* Emit input whenever WYSIWYG content is updated

* Update value when initialized for direct page loads

* Remove emit value on init

* Emit only when the observer exists

* Set count before observer check

* Remove extraneous init call

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-06-09 15:43:33 -04:00
Rijk van Zanten
008e9d50e0 Set count on fresh init of defered tinymce (#13789)
Fixes #13235 a little more
2022-06-09 15:32:24 -04:00
ian
6c1b43b716 Allow selection of image transformation in the WYSIWYG interface (#13777)
* Allow selection of image transformation in the WYSIWYG interface

* Fix warnings

* Disable width & height fields instead of hiding

* Cast to boolean

* Display preset width and height
2022-06-08 12:25:20 -04:00
Rijk van Zanten
658d3332f9 Fix various linter warnings, disable new rule (#13755)
A eslint vue update introduced a new rule that we don't want to use yet. This PR is disabling that rule
2022-06-06 11:34:00 -04:00
Rijk van Zanten
10eff1c751 Init count of soft limit in wysiwyg on first render (#13242)
Fixes #13235
2022-05-11 12:18:45 -04:00
Rijk van Zanten
81483a8012 Only watch for wysiwyg changes on first interaction (#12936) 2022-04-21 16:59:11 -04:00
programmarchy
fc9190e76e Display fullscreen rich text input below dialog instead of exiting fullscreen (#12045)
Co-authored-by: ian <licitdev@gmail.com>
2022-04-12 09:39:14 -04:00
Azri Kahar
e6e129615e fix M2O field deletion (#11538)
* fix M2O field deletion

* fix lint

* fix for MySQL

* Pull final dropColumn out of transaction

* Forget that, check for existing constraint before deleting it instead

* Fix lint warning in unrelated file

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-18 15:36:50 -04:00
ian
6d8b17ed6a Improvements to WYSIWYG interface (#12216)
* Ignore field value updating if it is disabled

* WYSiWYG: Allow to undo Insert image, Insert link, Insert media and Edit source code custom actions

* Bind MutationObserver to correct tinyMCE node

* Fix apply for disabled fields

* Emit null when empty

Co-authored-by: Andrew <trubay.andrey@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-03-18 14:53:57 -04:00
Ben Haynes
2474a0ddc0 Style updates (#12229)
* default badge color to red

* update notice styling to avoid color variants

* darker warning color

* update dark mode primary color

* update svg previews

* show slider values by default

* add subtle glow to field focus

* add additional color options

* no yellow in settings

* Give status display proper defaults

* Use setup script + translations

* Add low-contrast flag to preset

* update date-picker header style

* add placeholder to datetime interface

* Fix sizing of image preview

* Fix spacing / border situation

* select color

* Render small images at original size

* More file library love

* update datetime placeholder

* datetime font weights

* Fix style lint issue

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-18 15:52:04 +00:00
ian
bc0f23f092 Fix WYSIWYG link keyboard shortcut and add parent anchor tag detection (#12218)
* Fix WYSIWYG link keyboard shortcut and add parent anchor tag detection

* Fix saving of link on parent anchor tag
2022-03-18 08:51:14 -04:00
ian
079cf60425 Close WYSIWYG fullscreen when opening drawer or dialog (#12037) 2022-03-08 12:06:14 -05:00
rijkvanzanten
a0733f7dab Fix video rendering in wysiwyg 2022-03-07 18:32:52 -05:00
Rijk van Zanten
6a3eb823c3 Update base theme of the App (#11952)
* Add migration to remove default value from project_color

* Upgrade the default theme

* Do a pass over the header buttons

* Do another pass over --warning uses

* Little things

* Tweak smoke

* Use updated map

* Use dark system elements in dark mode

* Remove outdated files, update toasts

* Use correct delete button style for role

* Use primary for created point

* Tweak spacing in revisions section

* Use primary for sidebar sections

* Various color tweaks and changes

* Update base color palette

* Update "css reset" code

* Remove splashscreens, add default favicon

* Add primary highlight to datamodel page

* dark mode color update

* fix sign out hover color

* Does this help?!

* This fixes some loading issues

Fixes https://github.com/directus/directus/issues/10707

* Calculate default pretty background?

* Fix public view with logo

* Fix responsiveness of login page

* adjust notification group width to be equal

* Do an absolute pointless task that doesn't do anything

It was suggested that it could fix the stylelint error in tests, but alas

* Remove stylelint

Doesn't seem to play nice with script setup and other changes

Co-authored-by: Ben Haynes <ben@rngr.org>
2022-03-04 18:53:39 -05:00
ian
b3f7bd94a1 Remove access token from asset url when unnecessary (#10548)
* Remove access token when unnecessary

* Add missing translations

* Refactor naming convention

* Refactor naming convention

* Refactor access token usage for media upload

* Use static token for previews

* Add missing imageToken for image upload

* Rename imageToken to staticAccessToken

* Remove temporary access token from embedUrl

* Catch invalid URLs when replacing token

* Fix embedUrl not updating when source changed

* Patch audio and iframe uploads

* Hide tinymce offscreen selection

* Fix merge of interface fields

* Use static tokens except for preview

* Remove dirty checks through v-model for wysiwyg

* Add missing translations

* Fix lint warnings

* Revert naming from staticAccessToken to imageToken
2022-02-16 11:56:14 -05:00
Azri Kahar
9ad0cd632e Auto fill display text when adding link in WYSIWYG (#11599) 2022-02-16 09:27:44 -05:00
Azri Kahar
60928bafea Fix soft limit overflowing (#11526) 2022-02-08 21:18:37 +00:00
Azri Kahar
3768ebb0ce Update toolbar items order in WYSIWYG editor (#11294)
* update toolbar items order of WYSIWYG editor

* move ordering of removeformat
2022-01-26 09:36:24 -05:00
Jay Cammarano
b96d7775d3 Add soft character limit to various inputs (#11009)
* added soft_length to lang

* added softLength option to input interface

* softLength => textarea, md, wysiwyg

* really broken but counting characters

* return 0 not null oops

* characters remaining displaying

* percentageRemaining => shared

* placeholders => string

* markdown inputs need to change preview css

* account for multiple md inputs

* works for multiple inputs on a page

* let it breathe

* text area but no warning color (yet)

* newline is 1 char

* null => undefined

* shows with 0 hard limit left

* softlength tied to maxlength

* preview displaying md

* using share util

* Replace shared "interface" with util

* Add test setup

* Lock package versions

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-01-20 20:58:57 +00:00
ciril.tr
203b406d25 Add default folder upload to WYSIWYG editors (#7199)
* Add default folder upload to WYSIWYG editors

* Tweak options formatting + translations keys

* Tweak options structure

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-12-23 21:51:51 -05:00
Malte Jürgens
f6264371ef fix broken wysiwyg editor when width and height are set in image (#10440) 2021-12-10 14:29:13 -05:00
Azri Kahar
5a7e31bc98 update selection styling to use css variable (#10437) 2021-12-10 11:42:03 -05:00
Argomix
e629c17fdb Update input-rich-text-html.vue (#10331)
Soft wrap in HTML source code view.
2021-12-06 15:26:21 +00:00
Rijk van Zanten
b1af0a1cf7 Fix token manipulation on alignment change in images (#10234)
* Fix token manipulation on alignment change in images

Fixes #10145

* Update app/src/interfaces/input-rich-text-html/input-rich-text-html.vue

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
2021-12-02 14:41:59 -05:00
Malte Jürgens
1be8e1cd8d save wysiwyg image size in url params instead of html tags (#10054)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-12-01 19:30:39 +00:00
ian
1f9dfb5722 Set isEditorDirty flag before saving changes (#10048) 2021-11-25 10:52:31 -05:00
José Varela
528abe4593 Import 'Fira Mono' & 'Merriweather' into WYSIWYG (#9618)
* import 'Fira Mono' into wysiwyg

* use import statements for monospace & serif fonts

Co-authored-by: Azri Kahar <azrikahar@outlook.com>
2021-11-09 10:16:22 -05:00
Theraloss
a682e89c95 Append access_token to images in WYSIWYG only once (#9062)
* append access_token to image in wysiwyg only once

* do not append token in previewUrl when clicking an image from wysiwyg

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-29 16:08:25 +00:00
Rijk van Zanten
2720e0c18e Add new field flow (#9109)
* Add new grouping setup to interfaces

* [WIP] Start on new field flow

* Add preview svgs

* Update preview svg

* Add basic saving mechanism. Start on magic

* Add interface options to simple inputs

* Fix missing t

* Fix custom options not rendering

* Fix interface options overrides

* Sync m2o name key

* Setup m2o related collection input

* Add collections generation

* Add circular prevention & type syncing

* Small fixes in m2o context generation

* Move o2m options to fn structure

* Conclude o2m (i think)

* Start on toggle to advanced

* Style advanced toggle button

* Add localType File support, start documenting

* Add presentation/group localtypes

* Use function style interface options in m2m

* Don't require collection prop in field template component

* Implement most of m2m magic

* Restructure store updater

* Finish useFieldDetailStore restructure

* Only register root index in module folders

* Do the thing

* Finish m2m magic, tweak fallback styles

* Fix o2m display template setup

* Remove options comp for translations interface

* Show languages collection picker in translations

* Finish translations alterations

* Add magic for files type

* Officially wave goodbye to the old store setup

It served it's purpose, but what a nightmare to maintain. Welcome to the new version

* Update schema tab

* Add field pane

* Finish interface section

* Add display section

* Add conditions

* Update tabs to use localType from store

* Start on relationship tab

* Update m2m relational setup

* Start on m2o

* Finish m2o setup

* Finish o2m setup

* Add m2a magic

* Various tweaks

* Add m2a setup

* Add save button to advanced flow

* Load existing values on start

* Add upsert to stores, allow updating existing items

* Please the linter gods

* Remove seemingly redundant interface option

@Oreilles Seeing the geometry type is already configured in the schema configuration, this particular option on the interface feels redundant (?)

* Remove unnecessary option component overrides

* Track relationships in required fields for save state

* Fix relations previews on editing existing fields

* Use standard vs advanced for input options

* Remove note from simple field setup

* Add divider to field config

* Use background subdued

* Default required to false

* Add required icons to key/relationship

* Tweak colors

* Fix infinite loop in group creation

* Make setup responsive

* Allow switching interface at will

* Add m2a related collections picker

* Fix relations persisting on field deletion

* Add "Create in Advanced" shortcut

Just for you @joselcvarela

* Fix PK field staging on collection create

* Revert "Remove seemingly redundant interface option"

This reverts commit e5e09a051e.

* Fix map interface options
2021-10-25 20:29:04 -04:00
rijkvanzanten
b0c7fa20bd Handle empty toolbar in wysiwyg 2021-10-12 10:45:48 -04:00
Azri Kahar
0ebb932f45 Ignore WYSIWYG change on first load (#8603) 2021-10-07 18:25:57 -04:00
Azri Kahar
362f5de75e Fix WYSIWYG field not being cleared after "Save and Create New" (#7754)
* fix WYSIWYG field not being cleared

* return empty string when null for tinymce

* Update app/src/components/v-form/form-field.vue

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-09-03 02:17:31 +00:00
Azri Kahar
fc154a8ecc fix WYSIWYG field focus event (#7756) 2021-09-01 18:45:56 -04:00
Ben Haynes
eec1e630eb Update WYSIWYG styling 2021-09-01 16:16:51 -04:00
Nicola Krumschmidt
57442431d5 Make the asset url regex unambiguous (#7603) 2021-08-25 09:34:52 -04:00
rijkvanzanten
7cc15f2d40 Don't stage empty ? in img url 2021-08-24 20:44:43 -04:00
Jay Cammarano
db9020b378 Display private images in WYSIWYG editor (#7583)
* image is displaying in WYSIWYG

* remove access token before deletion

* remove token is being returned

* preview image displaying correctly

* added image token props handling

* imageToken added as params correctly

* refactor

* Fix regex, fix life's problems

* Remove eslint disable

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-08-24 18:55:51 -04:00
Nitwel
a9791227fd add simple audio support (#7452) 2021-08-17 11:03:59 -04:00
Rijk van Zanten
92e1ee77bd Add support for Conditional Fields (#6864)
* Add conditions field to directus_fields

* Add conditions configuration

* Apply conditional overrides

* Handle conditions in nested groups

* Fix reverse mutating conditions

* Start on filter setup interface

* Move field types/constants to shared

* [WIP] Updated client side filter validation

* Support logical operators in client validation step

* Use new validation util in conditions check

* Add nesting in filter seutp

* Add filter rule setup configurator

* Fixes that should've been done in the merge

* Strip out filter-settings interface

TBD in a new PR

* Move browser to index
2021-07-26 18:02:24 -04:00
Nicola Krumschmidt
32972f4c01 Move define extension functions to shared and expose them through extension-sdk (#6880)
* Move defineInterface to shared

* Split up utils into node and browser utils

* Move defineDisplay to shared

* Move defineLayout to shared

* Move defineModule to shared

* Add defineEndpoint and defineHook to define-extensions

* Expose define extension functions through extension-sdk

* Make route type of defineEndpoint more specific

* Simplify define extension functions

* Deduplicate types and local types definition

* Do not allow functional components in display handler

* Make interface options nullable

* Deduplicate extension types definition

* Fix utils/node exports
2021-07-22 17:02:29 +02:00
Rijk van Zanten
5f7dce54e2 Use stricter Vue eslint setting (#6833) 2021-07-15 13:49:59 -04:00
Rijk van Zanten
b77285f3c3 Fixed issue that would prevent source code editing from staging values in wysiwyg (#6455)
Fixes #6306
2021-06-22 19:56:46 -04:00
Rijk van Zanten
706f4af68b Fixed issue that could cause the HTML interface to emit a change on first load (#6264)
* Don't emit changes on first content setter

Fixes #6218

* Fix type issues
2021-06-14 14:45:54 -04:00