@brightspace-ui/core 2.17.0 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,25 +79,23 @@ Examples are provided to display how user-authored math can be embedded within y
79
79
  import '@brightspace-ui/core/tools/mathjax-test-context.js';
80
80
  </script>
81
81
  <d2l-html-block>
82
- <div class="mathml-container">
83
- <math xmlns="http://www.w3.org/1998/Math/MathML">
84
- <msqrt>
85
- <mn>3</mn>
86
- <mi>x</mi>
87
- <mo>&#x2212;</mo>
88
- <mn>1</mn>
89
- </msqrt>
90
- <mo>+</mo>
91
- <mo stretchy="false">(</mo>
92
- <mn>1</mn>
93
- <mo>+</mo>
82
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
83
+ <msqrt>
84
+ <mn>3</mn>
94
85
  <mi>x</mi>
95
- <msup>
96
- <mo stretchy="false">)</mo>
97
- <mn>2</mn>
98
- </msup>
99
- </math>
100
- </div>
86
+ <mo>&#x2212;</mo>
87
+ <mn>1</mn>
88
+ </msqrt>
89
+ <mo>+</mo>
90
+ <mo stretchy="false">(</mo>
91
+ <mn>1</mn>
92
+ <mo>+</mo>
93
+ <mi>x</mi>
94
+ <msup>
95
+ <mo stretchy="false">)</mo>
96
+ <mn>2</mn>
97
+ </msup>
98
+ </math>
101
99
  </d2l-html-block>
102
100
  ```
103
101
 
@@ -110,9 +108,7 @@ Examples are provided to display how user-authored math can be embedded within y
110
108
  import '@brightspace-ui/core/tools/mathjax-test-context.js';
111
109
  </script>
112
110
  <d2l-html-block>
113
- <div class="latex-container">
114
111
  $$ f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x $$ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
115
- </div>
116
112
  </d2l-html-block>
117
113
  ```
118
114
 
@@ -110,6 +110,18 @@
110
110
  </template>
111
111
  </d2l-demo-snippet>
112
112
 
113
+ <h2>HTML Block (inline)</h2>
114
+
115
+ <d2l-demo-snippet>
116
+ <template>
117
+ <span>Here's an inline html-block:</span>
118
+ <d2l-html-block inline>
119
+ I'm inline!
120
+ </d2l-html-block>
121
+ <span>Pretty cool!</span>
122
+ </template>
123
+ </d2l-demo-snippet>
124
+
113
125
  <h2>HTML Block (large font)</h2>
114
126
 
115
127
  <d2l-demo-snippet>
@@ -136,6 +136,10 @@ class HtmlBlock extends RtlMixin(LitElement) {
136
136
  * @type {Boolean}
137
137
  */
138
138
  compact: { type: Boolean },
139
+ /**
140
+ * Whether to display the HTML in inline mode
141
+ */
142
+ inline: { type: Boolean },
139
143
  /**
140
144
  * Whether to disable deferred rendering of the user-authored HTML. Do *not* set this
141
145
  * unless your HTML relies on script executions that may break upon stamping.
@@ -155,12 +159,14 @@ class HtmlBlock extends RtlMixin(LitElement) {
155
159
  position: relative;
156
160
  text-align: left;
157
161
  }
158
- :host([hidden]) {
159
- display: none;
160
- }
162
+ :host([hidden]),
161
163
  :host([no-deferred-rendering]) div.d2l-html-block-rendered {
162
164
  display: none;
163
165
  }
166
+ :host([inline]),
167
+ :host([inline]) div.d2l-html-block-rendered {
168
+ display: inline;
169
+ }
164
170
  :host([dir="rtl"]) {
165
171
  text-align: right;
166
172
  }
@@ -170,6 +176,7 @@ class HtmlBlock extends RtlMixin(LitElement) {
170
176
  constructor() {
171
177
  super();
172
178
  this.compact = false;
179
+ this.inline = false;
173
180
  this.noDeferredRendering = false;
174
181
 
175
182
  const rendererContextAttributes = getRenderers().reduce((attrs, currentRenderer) => {
@@ -3503,6 +3503,12 @@
3503
3503
  "type": "Boolean",
3504
3504
  "default": "false"
3505
3505
  },
3506
+ {
3507
+ "name": "inline",
3508
+ "description": "Whether to display the HTML in inline mode",
3509
+ "type": "boolean",
3510
+ "default": "false"
3511
+ },
3506
3512
  {
3507
3513
  "name": "no-deferred-rendering",
3508
3514
  "description": "Whether to disable deferred rendering of the user-authored HTML. Do *not* set this\nunless your HTML relies on script executions that may break upon stamping.",
@@ -3518,6 +3524,13 @@
3518
3524
  "type": "Boolean",
3519
3525
  "default": "false"
3520
3526
  },
3527
+ {
3528
+ "name": "inline",
3529
+ "attribute": "inline",
3530
+ "description": "Whether to display the HTML in inline mode",
3531
+ "type": "boolean",
3532
+ "default": "false"
3533
+ },
3521
3534
  {
3522
3535
  "name": "noDeferredRendering",
3523
3536
  "attribute": "no-deferred-rendering",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",