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

POC: Start using Codex #745

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ <h1>New Lexeme</h1>
import DevLexemeCreator from './src/data-access/DevLexemeCreator';
import DevLangCodeRetriever from './src/data-access/DevLangCodeRetriever';
import LanguageItemSearcher from './src/data-access/LanguageItemSearcher';
import '@wikimedia/codex-design-tokens/theme-wikimedia-ui.css';

const config = {
rootSelector: '#app',
Expand Down
152 changes: 152 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"node": ">=16"
},
"dependencies": {
"@wikimedia/codex": "^1.12.0",
"@wikimedia/codex-design-tokens": "^1.12.0",
"@wmde/wikibase-datamodel-types": "^0.2.0",
"@wmde/wikit-tokens": "^3.0.0-alpha.12",
"@wmde/wikit-vue-components": "^3.0.0-alpha.12",
Expand Down
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AnonymousEditWarning from '@/components/AnonymousEditWarning.vue';
import NewLexemeForm from '@/components/NewLexemeForm.vue';
import SearchExisting from '@/components/SearchExisting.vue';
import '@wmde/wikit-vue-components/dist/wikit-vue-components.css';
import '@wikimedia/codex/dist/codex.style.css';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to index.html, we don’t want the codex CSS to be included in our build!


</script>

Expand Down
45 changes: 27 additions & 18 deletions src/components/LemmaInput.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TextInput } from '@wmde/wikit-vue-components';
import RequiredAsterisk from '@/components/RequiredAsterisk.vue';
import { CdxField, CdxTextInput } from '@wikimedia/codex';
import RequiredAsterisk from '@/components/RequiredAsterisk.vue'; // eslint-disable-line @typescript-eslint/no-unused-vars
import { useMessages } from '@/plugins/MessagesPlugin/Messages';
import { useConfig } from '@/plugins/ConfigPlugin/Config';
import { useStore } from 'vuex';
Expand Down Expand Up @@ -51,23 +51,32 @@
</script>

<template>
<text-input
class="wbl-snl-lemma-input"
:label="messages.getUnescaped( 'wikibaselexeme-newlexeme-lemma' )"
:placeholder="messages.getUnescaped(
'wikibaselexeme-newlexeme-lemma-placeholder-with-example',
exampleLemma
)"
name="lemma"
aria-required="true"
:error="error"
:value="modelValue"
@input="$emit( 'update:modelValue', $event )"
<!-- TODO should :status and :messages be separate computeds? -->
<cdx-field
:status="error !== null ? 'error' : 'default'"
:messages="error !== null ? { error: error.message } : {}"
>
<template #suffix>
<required-asterisk />
</template>
</text-input>
<!-- TODO check escaping of :placeholder -->
<cdx-text-input
class="wbl-snl-lemma-input"
:placeholder="messages.getUnescaped(
'wikibaselexeme-newlexeme-lemma-placeholder-with-example',
exampleLemma
)"
name="lemma"
aria-required="true"
:model-value="modelValue"
@update:modelValue="$emit( 'update:modelValue', $event )"

Check warning on line 69 in src/components/LemmaInput.vue

View workflow job for this annotation

GitHub Actions / code-quality

v-on event '@update:modelValue' must be hyphenated
>
<!-- TODO codex docs say don’t mark required labels with an asterisk…
<template #suffix>
<required-asterisk />
</template>
-->
</cdx-text-input>
<template #label>{{ messages.getUnescaped( 'wikibaselexeme-newlexeme-lemma' ) }}</template><!-- TODO check escaping -->

Check warning on line 77 in src/components/LemmaInput.vue

View workflow job for this annotation

GitHub Actions / code-quality

This line has a length of 127. Maximum allowed is 100

Check warning on line 77 in src/components/LemmaInput.vue

View workflow job for this annotation

GitHub Actions / code-quality

Expected 1 line break after opening tag (`<template>`), but no line breaks found

Check warning on line 77 in src/components/LemmaInput.vue

View workflow job for this annotation

GitHub Actions / code-quality

Expected 1 line break before closing tag (`</template>`), but no line breaks found
</cdx-field>

Check warning on line 78 in src/components/LemmaInput.vue

View workflow job for this annotation

GitHub Actions / code-quality

Expected 1 line break before closing tag (`</template>`), but 2 line breaks found

</template>

<style lang="scss">
Expand Down
8 changes: 4 additions & 4 deletions src/components/NewLexemeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ export default {
padding: $dimension-layout-small;

// Border
border-style: $border-style-base;
border-width: $border-width-thin;
border-radius: $border-radius-base;
border-color: $border-color-base-subtle;
border-style: var( --border-style-base );
border-width: var( --border-width-base );
border-radius: var( --border-radius-base );
border-color: var( --border-color-muted );
}

.wbl-snl-copyright {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function getBuildConfig( isAppBuild: boolean ): BuildOptions {
formats: [ 'cjs' ],
},
rollupOptions: {
external: [ 'vue', 'vuex' ],
external: [ 'vue', 'vuex', '@wikimedia/codex' ],
},
};
}
Expand Down
Loading