Skip to content

Commit 003ef91

Browse files
Merge pull request #2539 from keymanapp/auto/A19S30-merge-master-into-staging
auto: A19S30 merge master into staging
2 parents 405e052 + b4767da commit 003ef91

74 files changed

Lines changed: 7700 additions & 45 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_includes/includes/index-content.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* be appended to the bottom of the list.
88
*/
99
function get_file_titles_by_index($base, $unsorted_items) {
10+
$items = [];
1011
$order = str_replace("\r\n", "\n", @file_get_contents($base.'__index.txt'));
1112
$order = explode("\n", $order);
1213
foreach($order as $item) {

_includes/includes/page-version.php

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
$PageVersion = new PageVersion();
77

88
class PageVersion {
9+
// TODO: - avoid public fields and use getters/setters instead
10+
911
public $active;
1012
public $versions, $basePath, $versionedPath, $subPath, $path;
1113
public $currentVersion;
@@ -71,29 +73,39 @@ static function WriteBanner() {
7173
global $PageVersion;
7274
if(!$PageVersion->active) return;
7375

74-
if($PageVersion->isCurrentPageCurrent() || !$PageVersion->currentFileExists) {
76+
if($PageVersion->isCurrentPageCurrent()) {
7577
// Don't show the banner if we are on the current version
7678
return;
7779
}
7880

79-
if($PageVersion->isCurrentPageOlder()) {
80-
$message = 'You are viewing an old version of this documentation';
81-
} else {
82-
$message = 'You are viewing an incomplete pre-release version of this documentation';
83-
}
84-
8581
$alertIcon =
8682
'<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="22" height="22" '.
8783
'style="vertical-align: bottom; padding-right: 4px" aria-hidden="true">'.
8884
'<path fill="orange" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 '.
8985
'1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 '.
9086
'0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 '.
9187
'0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>';
92-
$target = PageVersion::GetVersionedFilePath($PageVersion->basePath, $PageVersion->file, $PageVersion->currentVersion, $PageVersion->currentVersion);
88+
89+
if(!$PageVersion->currentFileExists) {
90+
$message = "You are viewing documentation of version {$PageVersion->versionedPath}, which is not included in the latest version";
91+
} else if($PageVersion->isCurrentPageOlder()) {
92+
$message = 'You are viewing an old version of this documentation';
93+
} else {
94+
$message = 'You are viewing an incomplete pre-release version of this documentation';
95+
}
96+
97+
if(!$PageVersion->currentFileExists) {
98+
# redirect to the base folder for the current version, as we don't have a mapping for this page
99+
$target = "{$PageVersion->basePath}/current-version/";
100+
$actionText = "to open the index page for version {$PageVersion->currentVersion}.";
101+
} else {
102+
$target = PageVersion::GetVersionedFilePath($PageVersion->basePath, $PageVersion->file, $PageVersion->currentVersion, $PageVersion->currentVersion);
103+
$actionText = "to open the current version, {$PageVersion->currentVersion}.";
104+
}
93105
$html =
94106
"<div id='version-banner'>$alertIcon $message. ".
95-
"<a href='{$target}'>Click here</a>".
96-
" to open the current version, {$PageVersion->currentVersion}.</div>";
107+
"<a href='{$target}'>Click here</a> $actionText".
108+
"</div>";
97109
echo $html;
98110
}
99111

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
},
88
"require-dev": {
99
"phpunit/phpunit": "^9.2"
10+
},
11+
"config": {
12+
"allow-plugins": false
1013
}
1114
}

composer.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

developer/core/19.0/changes.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
title: Changes - Keyman Core API
33
---
44

5+
## Changes between 18.0 and 19.0
6+
7+
* Removed deprecated `km_core_keyboard_attrs.folder_path`
8+
9+
## Changes between 17.0 and 18.0
10+
11+
* Replaced `km_core_keyboard_load` with `km_core_keyboard_load_from_blob`.
12+
Keyboard loading is now done in the engine, and the content of the
13+
keyboard passed to Core as a blob.
14+
* Deprecated `km_core_keyboard_attrs.folder_path`
15+
516
## Changes between 16.0 and 17.0
617

718
* The namespace identifier has changed from `km_kbp_` to `km_core_`.
@@ -61,4 +72,4 @@ title: Changes - Keyman Core API
6172
[km_core_event_flags]: processor#km_core_event_flags "km_core_event_flags enum"
6273
[km_core_process_event]: processor#km_core_process_event "km_core_process_event function"
6374
[km_core_event]: processor#km_core_event "km_core_event function"
64-
[km_core_event_code]: processor#km_core_event_code "km_core_event_code enum"
75+
[km_core_event_code]: processor#km_core_event_code "km_core_event_code enum"

developer/core/19.0/keyboards.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Provides read-only information about a keyboard.
2020
typedef struct {
2121
km_core_cp const * version_string;
2222
km_core_cp const * id;
23-
km_core_path_name folder_path;
2423
km_core_option_item const * default_options;
2524
} km_core_keyboard_attrs;
2625

@@ -33,9 +32,6 @@ typedef struct {
3332
`id`
3433
: Keyman keyboard ID string.
3534

36-
`folder_path`
37-
: Path to the unpacked folder containing the keyboard and associated resources.
38-
3935
`default_options`
4036
: Set of default values for any options included in the keyboard.
4137

@@ -662,4 +658,4 @@ km_core_state_to_json(km_core_state const *state,
662658
[km_core_event_flags]: processor#km_core_event_flags "km_core_event_flags enum"
663659
[km_core_process_event]: processor#km_core_process_event "km_core_process_event function"
664660
[km_core_event]: processor#km_core_event "km_core_event function"
665-
[km_core_event_code]: processor#km_core_event_code "km_core_event_code enum"
661+
[km_core_event_code]: processor#km_core_event_code "km_core_event_code enum"

developer/engine/web/19.0/reference/core/addKeyboards.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ keyman.addKeyboards(spec[, spec...])
2626
fulfilled upon adding keyboards.
2727

2828
The promise is an array containing a combination of the following:
29-
* successfully registered keyboard objects which define some or all of these [properties](../keyboard_properties)
29+
30+
* successfully registered keyboard objects which define some or all of these
31+
[properties](../keyboard_properties)
3032
* [ErrorStub](../keyboard_registration_errors) objects for keyboards that failed to register
3133

3234
## Description
@@ -35,7 +37,8 @@ The keyboard spec can be a string or an object. Multiple keyboard specs can be
3537
specified in a single call, which can reduce the round-trip cost of multiple
3638
calls to Keyman Cloud servers (when using Keyman Cloud).
3739

38-
For general information and example uses of this method, please see the [Adding Keyboards](../../guide/adding-keyboards) page from the guide section.
40+
For general information and example uses of this method, please see the
41+
[Adding Keyboards](../../guide/adding-keyboards) page from the guide section.
3942

4043
### Using a `string`
4144

@@ -48,7 +51,7 @@ The string format is one of the following:
4851
* `'keyboardID@languageID'`: Loads a specific keyboard + language combination
4952

5053
The keyboard catalogue is online at
51-
[http://keyman.com/developer/keymanweb/keyboards](http://keyman.com/developer/keymanweb/keyboards).
54+
[https://keyman.com/developer/keymanweb/keyboards](https://keyman.com/developer/keymanweb/keyboards).
5255

5356
### Using an `object`
5457

@@ -59,7 +62,6 @@ known as KeymanWeb Server Data API):
5962

6063
The `spec` object contains the following members:
6164

62-
6365
`name`
6466

6567
: `string`
@@ -143,7 +145,7 @@ The `spec.languages` object contains the following members:
143145

144146
: `array|object` <span class="optional">optional</span>
145147

146-
An array of Font objects (see definition below) or single object describing
148+
An array of Font objects (see `font` definition below) or single object describing
147149
fonts for input fields and the OSK (if `oskFont` is not present.)
148150

149151
`oskFont`

developer/engine/web/19.0/reference/core/addKeyboardsForLanguage.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,31 @@ keyman.addKeyboardsForLanguage(spec[, spec...])
1818

1919
: Type: `string`
2020

21-
Language name string. Appending `$` to the language name will cause all available keyboards for that language to be loaded rather than the default keyboard.
21+
Language name string. Appending `$` to the language name will cause all available keyboards for
22+
that language to be loaded rather than only the default keyboard.
2223

2324
### Return Value
2425

2526
`Promise`: A [JavaScript Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
2627
fulfilled upon adding keyboards.
2728

2829
The promise is an array containing the following:
29-
* successfully registered keyboard objects which define some or all of these [properties](../keyboard_properties)
30+
31+
* successfully registered keyboard objects which define some or all of these
32+
[properties](../keyboard_properties)
3033

3134
## Description
3235

3336
The language spec is a string. Multiple language specs can also be
3437
specified in a single call, which can reduce the round-trip cost of multiple
3538
calls to Keyman Cloud servers (when using Keyman Cloud).
3639

37-
The first call to `addKeyboardsForLanguage()` makes an additional call to the Keyman API to load the current list of keyboard/language associations. This determines the default keyboards that are added for the language.
40+
The first call to `addKeyboardsForLanguage()` makes an additional call to the Keyman API to load
41+
the current list of keyboard/language associations. This determines the default keyboards that
42+
are added for the language.
3843

39-
For general information and example uses of this method, please see the [Adding Keyboards](../../guide/adding-keyboards) page from the guide section.
44+
For general information and example uses of this method, please see the
45+
[Adding Keyboards](../../guide/adding-keyboards) page from the guide section.
4046

4147
### Using a `string`
4248

developer/engine/web/19.0/reference/interface/contextExOutput.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ gap between desktop and web core functionality for `context(n)` matching on `not
1111
## Syntax
1212

1313
```js
14-
keyman.interface.contextExOutput(dn, outputTarget, contextLength, contextOffset);
14+
keyman.interface.contextExOutput(dn, textStore, contextLength, contextOffset);
1515
```
1616

1717
or
1818

1919
```js
20-
KeymanWeb.KCXO(dn, outputTarget, contextLength, contextOffset); // Shorthand
20+
KeymanWeb.KCXO(dn, textStore, contextLength, contextOffset); // Shorthand
2121
```
2222

2323
## Parameters
@@ -26,8 +26,8 @@ or
2626
: Type: `number`
2727
: number of characters to delete left of cursor
2828

29-
`outputTarget`
30-
: Type: `OutputTarget`
29+
`textStore`
30+
: Type: `TextStore`
3131
: target to output to
3232

3333
`contextLength`

developer/language/guide/control-keys.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,42 @@ unnecessary [issue #14718](https://github.com/keymanapp/keyman/issues/14718).
129129
Using control characters in the context in a [`readonly`
130130
group](groups#readonly-clause) is safe; no special handling is required.
131131

132+
# Non-breaking space (NBSP) in context
133+
134+
Non-breaking space (NBSP, U+00A0) is used in the digital world to prevent automatic line
135+
breaks from being inserted between two words. Said another way, it prevents two words
136+
being separated on to two separate lines. In some applications NBSP are returned in the
137+
context to Keyman (for example, see issue with Firefox [#14945](https://github.com/keymanapp/keyman/issues/14945)).
138+
Therefore in this case NBSP should be considered in a rule that detects
139+
a blank space.
140+
141+
A simple example: when <kbd>e</kbd> is pressed, output an `` after a space, and output `ε` otherwise:
142+
```
143+
store(spaceChrs) U+0020 U+00A0
144+
c The nbsp Unicode Character is U+00A0 and space is U+0020.
145+
any(spaceChrs) + [K_E] > context U+1f10
146+
+ [K_E] > U+03B5
147+
```
148+
149+
A example taken from the [greek_tonzio keyboard](https://github.com/keymanapp/keyboards/tree/master/release/g/greek_tonizo). This keyboard uses stores; see [`store()`](../reference/store):
150+
151+
```
152+
c Characters usually found before words These characters are Space, parenthesis, quotes etc and to this we add the nbsp
153+
store(beforeWordChars) U+0020 U+0028 U+002D U+0027 \
154+
U+0022 U+003A U+007B U+00AB \
155+
U+00B6 U+00A9 U+000A U+00A0
156+
157+
c These are the characters [ ἀ ἐ ἠ ἰ ὀ ὑ ὠ Ἀ Ἐ Ἠ Ἰ Ὀ Ὑ Ὠ]
158+
store(fwnWithBreathing) U+1F00 U+1F10 U+1F20 U+1F30 U+1F40 U+1F51 U+1F60 \
159+
U+1F08 U+1F18 U+1F28 U+1F38 U+1F48 U+1F59 U+1F68
160+
```
161+
162+
Then we can have a rule that adds the breathing when the encountering a "before word" character:
163+
```
164+
c ------- GENERAL RULE: AUTOMATIC PSILI AT BEGINNING OF WORD STARTING WITH VOWEL ------
165+
any(beforeWordChars) + any(vowels) > context index(fwnWithBreathing,2)
166+
```
167+
132168
# References
133169

134170
* [Issue #14148](https://github.com/keymanapp/keyman/issues/14148#issuecomment-3269582559)

0 commit comments

Comments
 (0)